/*
 * SMARTDIGIT Backoffice — tema premium (sidebar escuro)
 *
 * Padrões de UI (formulários, botões, modais, uploads): docs/UI-BACKOFFICE.md
 * Tokens e alinhamento com a PWA: docs/UI-DESIGN-TOKENS.md
 *
 * Botões: .bo-btn, .bo-btn--primary | --secondary | --danger, .bo-btn--lg | --sm
 * Formulários: .bo-form-grid, .bo-form-row, .bo-form-panel
 * Modais: .bo-modal, .bo-modal__dialog, .bo-modal__head | __body | __foot
 * Upload branding/loja: .bo-store-logo-upload__input (ver páginas settings / store_edit)
 */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --zswms-navy: #0b1426;
  --zswms-navy-mid: #111d35;
  --zswms-accent: #0ea5e9;
  --zswms-accent-hover: #0284c7;
  --zswms-bg: #f1f5f9;
  --zswms-card: #ffffff;
  --zswms-text: #0f172a;
  --zswms-muted: #64748b;
  /* Cabeçalhos de página / secção / modal — um só corpo tipográfico */
  --bo-heading-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bo-heading-size: 1.2rem;
  --bo-heading-weight: 700;
  --bo-heading-color: var(--zswms-text);
  --bo-heading-letter: -0.02em;
}

.zswms-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--zswms-bg);
  color: var(--zswms-text);
  display: flex;
}

.zswms-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--zswms-navy) 0%, #0d1a2d 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
}

.zswms-sidebar__brand {
  padding: 1.35rem 1.35rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.zswms-sidebar__brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.zswms-sidebar__brand-start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.zswms-sidebar__toggle {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.zswms-sidebar__toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.zswms-sidebar__toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.45);
}

.zswms-sidebar__toggle-icon {
  display: flex;
  line-height: 0;
}

/* Recolher: barra estreita com logo + botão sempre clicáveis (não usar width:0 no aside — escondia o próprio toggle) */
@media (min-width: 901px) {
  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar {
    width: 76px;
    min-width: 76px;
    flex: 0 0 76px;
    overflow: hidden;
    transition: width 0.22s ease, min-width 0.22s ease, flex-basis 0.22s ease;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar__brand {
    padding: 1.1rem 0.45rem;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar__brand-row {
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar__brand-start {
    justify-content: center;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar__brand-text {
    display: none;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-nav {
    padding: 0.75rem 0.35rem;
    align-items: stretch;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-nav__link {
    justify-content: center;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-nav__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar__user {
    padding: 0.85rem 0.45rem;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar__pwa-wrap {
    padding: 0 0.45rem 0.6rem;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar__user-meta {
    display: none;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar__logout {
    margin-top: 0;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 0.35rem;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar__logout-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .zswms-body.zswms-sidebar--collapsed .zswms-sidebar__logo-img {
    width: 36px;
    height: 36px;
  }
}

.zswms-topbar__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

@media (max-width: 900px) {
  .zswms-sidebar__toggle {
    display: none;
  }
}

.zswms-sidebar__logo-img {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.zswms-sidebar__brand-text {
  min-width: 0;
}

.zswms-sidebar__logo {
  display: block;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}

.zswms-sidebar__sub {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.zswms-nav {
  padding: 1rem 0.65rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.zswms-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.zswms-nav__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: inherit;
  opacity: 0.95;
}

.zswms-nav__icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.zswms-nav__label {
  min-width: 0;
}

.zswms-nav__link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}

.zswms-nav__link.is-active {
  background: linear-gradient(90deg, rgba(14,165,233,.25) 0%, rgba(14,165,233,.08) 100%);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--zswms-accent);
}

.zswms-sidebar__user {
  padding: 1.15rem 1.35rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 0.8rem;
}

.zswms-sidebar__pwa-wrap {
  padding: 0 1.35rem 0.75rem;
}

.zswms-sidebar__user-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.88rem;
}

.zswms-sidebar__user-role {
  margin-top: 0.25rem;
  color: #94a3b8;
  font-size: 0.72rem;
}

.zswms-sidebar__logout {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  margin-top: 0.85rem;
  padding: 0.45rem 0.9rem;
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  color: #e2e8f0;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.82rem;
  width: 100%;
  box-sizing: border-box;
}

.zswms-sidebar__logout-icon {
  flex-shrink: 0;
  display: inline-flex;
  line-height: 0;
  color: inherit;
}

.zswms-sidebar__logout-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.zswms-sidebar__logout:hover {
  background: rgba(239,68,68,.25);
  color: #fff;
}

.zswms-sidebar__pwa {
  background: rgba(14, 165, 233, .18);
  color: #dbeafe;
  margin-top: 0;
  margin-bottom: 0;
  width: 100%;
  padding: 0.45rem 0.9rem;
}

.zswms-sidebar__pwa:hover {
  background: rgba(14, 165, 233, .32);
  color: #fff;
}

.zswms-shell {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.zswms-body--no-sidebar .zswms-shell {
  width: 100%;
}

.zswms-body--no-sidebar .zswms-main {
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
}

.zswms-topbar {
  background: var(--zswms-card);
  border-bottom: 1px solid #e2e8f0;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.zswms-topbar__title {
  margin: 0;
  font-family: var(--bo-heading-font);
  font-size: var(--bo-heading-size);
  font-weight: var(--bo-heading-weight);
  color: var(--bo-heading-color);
  letter-spacing: var(--bo-heading-letter);
}

.zswms-lang {
  display: flex;
  gap: 0.35rem;
}

.zswms-lang__btn {
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--zswms-muted);
  border: 1px solid #e2e8f0;
  background: #fff;
}

.zswms-lang__btn:hover { border-color: var(--zswms-accent); color: var(--zswms-accent); }
.zswms-lang__btn.is-active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  border-color: transparent;
}

.zswms-main {
  padding: 1.35rem 1.5rem 2.5rem;
  max-width: 90rem;
  flex: 1;
  min-height: 0;
}

/* Parceiros: preencher a área útil e igualar altura lista + edição */
.zswms-main:has(.bo-partner-shell) {
  display: flex;
  flex-direction: column;
}

/*
 * Empresas (company_edit): evitar scroll na janela em paralelo com .bo-partner-tabbed__panels.
 * Com body sem altura máxima, o conteúdo empurrava o viewport e apareciam dois scrollbars (PWA, etc.).
 */
.zswms-body:has(#bo-partner-companies-root[data-company-page="1"]) {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.zswms-body:has(#bo-partner-companies-root[data-company-page="1"]) .zswms-sidebar {
  min-height: 0;
  max-height: 100dvh;
  overflow: hidden;
}

.zswms-body:has(#bo-partner-companies-root[data-company-page="1"]) .zswms-nav {
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.zswms-body:has(#bo-partner-companies-root[data-company-page="1"]) .zswms-shell {
  min-height: 0;
  overflow: hidden;
}

.zswms-body:has(#bo-partner-companies-root[data-company-page="1"]) .zswms-main {
  min-height: 0;
  overflow: hidden;
}

/* Login página (split) */
.zswms-login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

html, body {
  height: 100%;
}

.zswms-login-hero {
  background: radial-gradient(ellipse 120% 80% at 30% 20%, #1e3a5f 0%, #0b1426 55%, #060d18 100%);
  color: #e2e8f0;
  padding: 2.5rem 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100dvh;
}

.zswms-login-hero__logo {
  display: block;
  max-width: min(100%, 320px);
  height: auto;
  margin-bottom: 1.25rem;
}

.zswms-login-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(14,165,233,.2);
  color: #7dd3fc;
  margin-bottom: 1rem;
}

.zswms-login-hero__lead {
  margin: 0;
  line-height: 1.55;
  color: #94a3b8;
  font-size: 0.95rem;
  max-width: 28rem;
}

.zswms-login-hero__copy {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

.zswms-login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f8fafc;
  min-height: 100dvh;
}

.zswms-login-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, #0f172a 0%, #0b1426 100%);
  border-radius: 16px;
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255,255,255,.06);
}

.zswms-login-card__logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 0.65rem;
}

.zswms-login-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  color: #fff;
  font-weight: 700;
}

.zswms-login-card .zswms-login-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #38bdf8;
  margin-bottom: 0.5rem;
}

.zswms-login-card .zswms-login-sub {
  font-size: 0.88rem;
  color: #94a3b8;
  margin: 0 0 1.35rem;
  line-height: 1.45;
}

.zswms-login-card label {
  display: block;
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.zswms-login-card input[type="email"],
.zswms-login-card input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(15,23,42,.6);
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.zswms-login-card button[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  margin-top: 0.25rem;
}

.zswms-login-card button[type="submit"]:hover {
  filter: brightness(1.05);
}

.zswms-login-lang {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.zswms-login-lang a {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.zswms-login-lang a.is-active {
  background: rgba(14,165,233,.22);
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.45);
}

.zswms-login-err {
  color: #fca5a5;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}

.zswms-login-pwa {
  margin-top: 1.25rem;
  text-align: center;
}

.zswms-login-pwa__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.zswms-login-pwa__link:hover {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(125, 211, 252, 0.55);
}

.zswms-login-pwa__link:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 3px;
}

.zswms-login-pwa__icon {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.95;
}

.bo-twofa-code-input {
  letter-spacing: 0.2em;
  font-size: 1.05rem;
  max-width: 11rem;
}

.bo-twofa-login-form .bo-twofa-otp-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 1rem;
}

.bo-twofa-login-form .bo-twofa-otp-digit {
  width: 100%;
  min-width: 0;
  text-align: center;
  padding: 0.75rem 0;
  border-radius: 10px;
  border: 1px solid rgba(14, 165, 233, 0.5);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(2, 132, 199, 0.15) 100%);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  box-sizing: border-box;
}

.bo-twofa-login-form .bo-twofa-otp-digit:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.22);
}

.bo-twofa-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.bo-twofa-status--off {
  color: #94a3b8;
  font-size: 0.9rem;
  margin: 0 0 0.65rem;
}

.bo-twofa-form {
  margin-top: 0.75rem;
}

.bo-twofa-form--admin {
  margin-top: 1rem;
}

.bo-twofa-setup__lead {
  margin: 0 0 0.5rem;
}

.bo-twofa-qr {
  margin: 0.5rem 0;
}

.bo-twofa-secret code {
  font-size: 0.88rem;
  word-break: break-all;
}

.bo-twofa-status--on {
  color: #86efac;
  font-weight: 600;
  margin: 0.5rem 0;
}

@media (max-width: 900px) {
  .zswms-login-page { grid-template-columns: 1fr; }
  .zswms-login-hero { min-height: auto; padding: 1.75rem; }
  .zswms-login-panel { min-height: auto; }
}

@media (max-width: 900px) {
  .zswms-body { flex-direction: column; }
  .zswms-sidebar {
    width: 100%;
    min-height: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .zswms-nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
  .zswms-sidebar__pwa-wrap { width: 100%; padding: 0 1.1rem 0.65rem; }
  .zswms-sidebar__user { width: 100%; border-top: 1px solid rgba(255,255,255,.08); }
}

/* Conteúdo legado bo-* (cartões, tabelas) */
.bo-main {
  padding: 0;
  max-width: none;
}

.bo-dashboard-lead {
  margin: 0 0 1.25rem;
  color: #3d4450;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Dashboard: ocupar largura útil em monitores grandes */
.zswms-main:has(.bo-dashboard-lead) {
  max-width: none;
  width: 100%;
}

/* Cobranças: mesma lógica fluida para aproveitar toda a largura útil. */
.zswms-main:has(.bo-billing-intro) {
  max-width: none;
  width: 100%;
}

/* Definições (todos os tabs): ocupar largura útil total */
.zswms-main:has(.bo-settings-st) {
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.bo-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.bo-stat-card {
  border-radius: 10px;
  padding: 1.1rem 1.15rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

a.bo-stat-card {
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.bo-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.14);
}
a.bo-stat-card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.bo-stat-card--action:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.bo-stat-card__label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.92;
}

.bo-stat-card__value {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.35rem 0;
  font-variant-numeric: tabular-nums;
}

.bo-stat-card__hint {
  font-size: 0.75rem;
  opacity: 0.88;
  line-height: 1.3;
}

.bo-stat-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.bo-dashboard-lead__accent {
  color: #0066b3;
  font-weight: 600;
}

.bo-stat-card--partners { background: linear-gradient(135deg, #0e7490 0%, #155e75 100%); }
.bo-stat-card--tenant  { background: linear-gradient(135deg, #0066b3 0%, #004a82 100%); }
.bo-stat-card--company { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%); }
.bo-stat-card--stores  { background: linear-gradient(135deg, #0369a1 0%, #075985 100%); }
.bo-stat-card--users   { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }
.bo-stat-card--pwa     { background: linear-gradient(135deg, #5b21b6 0%, #4c1d95 100%); }
.bo-stat-card--online  { background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%); }
.bo-stat-card--pwa-online { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
.bo-stat-card--billing { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); }

.bo-dash-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

@media (min-width: 1600px) {
  .bo-stat-grid,
  .bo-stat-grid--wide {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .bo-dash-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bo-chart-card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 1.15rem 1.25rem 1.35rem;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.bo-chart-card__title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1d21;
}

.bo-chart-card__sub {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: #64748b;
}

.bo-chart-card__canvas-wrap {
  position: relative;
  height: 240px;
}

.bo-card--billing {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 102, 179, 0.07);
  border-color: #d3e4f5;
}

.bo-tile--premium {
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.bo-card--accent {
  border-color: #b8d4f0;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 48%);
  box-shadow: 0 2px 12px rgba(0,102,179,.08);
}

.bo-intro {
  font-size: 0.9rem;
  color: #495057;
  margin: -0.25rem 0 1rem;
  line-height: 1.45;
}

.bo-code-block {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  background: #f1f3f5;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  color: #495057;
  word-break: break-all;
}

.bo-code-muted {
  font-size: 0.85rem;
  color: #6b7280;
}

/**
 * Mensagens de feedback (guardado, erro, etc.):
 * por defeito = fundo do ecrã, centradas — mesmo estilo visual que .bo-toast (ST).
 * Use .bo-flash--embedded para avisos no fluxo da página (ex.: dashboard).
 * Use .bo-flash--inline para badges dentro de células de tabela.
 */
.bo-flash:not(.bo-flash--embedded):not(.bo-flash--inline) {
  position: fixed;
  left: 50%;
  bottom: 1.35rem;
  transform: translateX(-50%);
  z-index: 10000;
  margin: 0;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.bo-flash--ok:not(.bo-flash--embedded):not(.bo-flash--inline) {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
}

.bo-flash--err:not(.bo-flash--embedded):not(.bo-flash--inline) {
  background: #7f1d1d;
  color: #fef2f2;
  border: 1px solid #991b1b;
}

.bo-flash--warn:not(.bo-flash--embedded):not(.bo-flash--inline) {
  background: #78350f;
  color: #fffbeb;
  border: 1px solid #92400e;
}

/* Avisos no conteúdo (não sobrepõem o ecrã) */
.bo-flash--embedded {
  padding: 0.65rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.bo-flash--embedded.bo-flash--ok {
  background: #e6f7ed;
  color: #0d6832;
  border: 1px solid #a3e4c1;
}

.bo-flash--embedded.bo-flash--err {
  background: #fdeaea;
  color: #a61b1b;
  border: 1px solid #f5b5b5;
}

.bo-flash--embedded.bo-flash--warn {
  background: #fff8e6;
  color: #8a6100;
  border: 1px solid #f5d78a;
}

/* Badge compacto em células (migrações, etc.) */
.bo-flash--inline {
  display: inline-block;
  margin: 0;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 6px;
  font-weight: 600;
}

.bo-flash--inline.bo-flash--ok {
  background: #e6f7ed;
  color: #0d6832;
  border: 1px solid #a3e4c1;
}

.bo-flash--inline.bo-flash--err {
  background: #fdeaea;
  color: #a61b1b;
  border: 1px solid #f5b5b5;
}

.bo-card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.bo-card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--bo-heading-font);
  font-size: var(--bo-heading-size);
  font-weight: var(--bo-heading-weight);
  color: var(--bo-heading-color);
  letter-spacing: var(--bo-heading-letter);
}

.bo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.bo-tile {
  display: block;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.bo-tile:hover {
  border-color: #0066b3;
  box-shadow: 0 2px 8px rgba(0,102,179,.12);
}

.bo-tile-title {
  font-weight: 600;
  color: #0066b3;
  margin-bottom: 0.35rem;
}

.bo-tile-desc {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.4;
}

.bo-breadcrumb {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.bo-breadcrumb a {
  color: #0066b3;
  text-decoration: none;
}

.bo-breadcrumb a:hover { text-decoration: underline; }

.bo-table-wrap { overflow-x: auto; }

table.bo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.bo-table th,
.bo-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e4e7ec;
}

.bo-table th {
  font-weight: 600;
  color: #3d4450;
  background: #f9fafb;
}

.bo-table tr:hover td { background: #fafbfc; }

.bo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid #e4e7ec;
}

a.bo-tabs__btn {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

a.bo-tabs__btn:hover {
  color: #0f172a;
}

a.bo-tabs__btn.is-active {
  color: #0066b3;
  border-bottom-color: #0066b3;
}

.bo-settings-st {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.bo-settings-st .bo-settings-tabbed,
.bo-settings-st .bo-partner-tabbed__panels,
.bo-settings-st .bo-settings-st__card {
  width: 100%;
  max-width: none;
}

.bo-settings-st .bo-settings-tabbed {
  flex: 1;
  min-height: 0;
}

.bo-settings-st .bo-partner-tabbed__panels {
  flex: 1;
  min-height: 0;
}

.bo-tabs--st-settings {
  border-bottom: 0;
  margin-bottom: 1rem;
  gap: 0.55rem;
}

a.bo-tabs__btn--st {
  border: 1px solid #dbe7f3;
  border-bottom: 1px solid #dbe7f3;
  background: #fff;
  border-radius: 10px;
  padding: 0.48rem 0.9rem;
  color: #475569;
  transition: border-color .15s, color .15s, box-shadow .15s, background .15s;
}

a.bo-tabs__btn--st:hover {
  color: #0369a1;
  border-color: #9ec5e5;
  background: #f8fbff;
}

a.bo-tabs__btn--st.is-active {
  color: #005a9f;
  border-color: #6da9d9;
  background: linear-gradient(180deg, #f4faff 0%, #ffffff 100%);
  box-shadow: inset 0 -2px 0 #0ea5e9;
}

.bo-settings-st__card {
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

/* Definições: conteúdo dos tabs no mesmo padrão ST de Utilizadores
   (sem "dupla barra" abaixo da tabbar) */
.bo-settings-tabbed .bo-partner-tabbed__panels > .bo-settings-st__card {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

/* Traduções: sub-abas Backoffice | PWA — pastilhas ST (fora de .bo-partner-tabbed__bar) */
.bo-settings-st .bo-i18n-subtab.bo-tabbar--line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.bo-settings-st .bo-i18n-subtab.bo-tabbar--line .bo-tabbar__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  box-shadow: none;
}

.bo-settings-st .bo-i18n-subtab.bo-tabbar--line .bo-tabbar__btn:hover {
  color: #0f172a;
  background: #f8fafc;
}

.bo-settings-st .bo-i18n-subtab.bo-tabbar--line .bo-tabbar__btn.is-active {
  color: #0f172a;
  font-weight: 600;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.bo-settings-st .bo-i18n-subtab {
  margin-top: 0.35rem;
  margin-bottom: 0.25rem;
}

/* Traduções: bloco ST (barra + .bo-table-wrap--partner-users) */
.bo-settings-st .bo-i18n-st-block {
  margin-top: 0.25rem;
}

.bo-settings-st .bo-table-wrap--partner-users .bo-i18n-premium-table {
  min-width: 58rem;
}

.bo-settings-st .bo-i18n-premium-table td {
  vertical-align: middle;
}

.bo-settings-st .bo-i18n-premium-table td code {
  font-size: 0.8rem;
  word-break: break-word;
  color: #334155;
  line-height: 1.35;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.bo-settings-st .bo-i18n-premium-table .bo-smartinput {
  width: 100%;
  min-width: 10rem;
  font-size: 0.875rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bo-settings-st .bo-i18n-premium-table .bo-smartinput:hover {
  border-color: #cbd5e1;
}

.bo-settings-st .bo-i18n-premium-table .bo-smartinput:focus {
  outline: none;
  border-color: #7dd3fc;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.bo-settings-st .bo-table-wrap--partner-users .bo-i18n-premium-table .bo-th-sort {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.82rem;
}

.bo-settings-st .bo-table-wrap--partner-users .bo-i18n-premium-table thead th:first-child .bo-th-sort {
  text-transform: none;
}

.bo-settings-api-grid {
  margin-top: 0.25rem;
}

.bo-settings-api-grid .bo-form-row input[type="url"],
.bo-settings-api-grid .bo-form-row input[type="number"],
.bo-settings-api-grid .bo-form-row input.bo-smartinput {
  width: 100%;
  max-width: none;
}

.bo-settings-api-checkbox-row {
  align-self: end;
}

.bo-settings-secret-wrap {
  position: relative;
  width: 100%;
}

.bo-settings-secret-wrap .bo-settings-secret-input {
  padding-right: 2.65rem;
}

.bo-settings-api-test-feedback {
  margin: 0.2rem 0 0.85rem;
  font-size: 0.86rem;
}

.bo-settings-api-test-feedback.is-ok {
  color: #0f766e;
}

.bo-settings-api-test-feedback.is-error {
  color: #b91c1c;
}

/* API REST: colapsável por defeito (Definições + Empresas) */
.bo-settings-api-rest-head {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.bo-settings-api-rest-details {
  flex: 1;
  min-width: 0;
}

.bo-settings-api-rest-details > summary {
  list-style: none;
  cursor: pointer;
}

.bo-settings-api-rest-details > summary::-webkit-details-marker {
  display: none;
}

.bo-settings-api-rest-details__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
}

.bo-settings-api-rest-details__summary::before {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-right: 0.15rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  opacity: 0.75;
  flex-shrink: 0;
}

.bo-settings-api-rest-details[open] > .bo-settings-api-rest-details__summary::before {
  transform: rotate(45deg);
  margin-top: 0.1em;
}

.bo-settings-api-rest-details__body {
  padding-top: 0.5rem;
}

.billing-detail-row td {
  background: #f8fafc;
  border-bottom: 1px solid #e4e7ec;
  padding-top: 0.5rem;
  padding-bottom: 0.85rem;
  vertical-align: top;
}

.bo-table tr.billing-detail-row:hover td { background: #f1f5f9; }

.billing-detail {
  padding: 0 0 0 0.25rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.billing-detail-line {
  margin: 0 0 0.5rem;
}

.billing-detail-empty {
  margin: 0.15rem 0 0;
}

table.billing-detail-stores {
  width: 100%;
  max-width: 26rem;
  border-collapse: collapse;
  margin-top: 0.35rem;
}

.billing-detail-stores th,
.billing-detail-stores td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.82rem;
}

.billing-detail-stores th {
  font-weight: 600;
  color: #64748b;
  background: transparent;
}

.bo-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.bo-badge--ok { background: #e6f7ed; color: #0d6832; }
.bo-badge--off { background: #f3f4f6; color: #6b7280; }

.bo-form-row { margin-bottom: 0.9rem; }

.bo-form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #3d4450;
  margin-bottom: 0.35rem;
}

.bo-form-row input[type="text"],
.bo-form-row input[type="email"],
.bo-form-row input[type="password"],
.bo-form-row input[type="url"],
.bo-form-row input[type="number"],
.bo-form-row textarea,
.bo-form-row select {
  width: 100%;
  max-width: 28rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
}

.bo-form-row textarea {
  min-height: 140px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  max-width: 100%;
}

.bo-form-row .bo-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.3rem;
}

.bo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.bo-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.bo-btn--primary {
  background: #0066b3;
  color: #fff;
}

.bo-btn--primary:hover { background: #004d8c; }

.bo-btn--secondary {
  background: #fff;
  color: #3d4450;
  border: 1px solid #d1d5db;
}

.bo-btn--secondary:hover { background: #f6f8fa; }

.bo-btn--danger {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.bo-btn--danger:hover { background: #fef2f2; }

.bo-inline-form { display: inline; }

/* —— Página: cabeçalho + listagens —— */
.bo-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.bo-page-head__kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--zswms-muted);
  margin: 0 0 0.35rem;
}

.bo-page-head__title {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--zswms-text);
}

.bo-page-head__subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--zswms-muted);
  line-height: 1.5;
  max-width: 42rem;
}

.bo-page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.bo-btn--lg {
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.bo-btn--sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

.bo-card--flush {
  padding: 0;
  overflow: hidden;
}

.bo-empty-hint {
  margin: 0;
  color: var(--zswms-muted);
  padding: 1.25rem 1.35rem;
}

/* Painel de formulário (estilo modal / ficha) */
.bo-form-panel {
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.bo-form-panel__head {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0ea5e9 120%);
  padding: 1rem 1.35rem;
  color: #fff;
}

.bo-form-panel--danger-zone .bo-form-panel__head {
  background: linear-gradient(135deg, #450a0a 0%, #991b1b 100%);
}

.bo-form-panel__head-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.bo-form-panel__body {
  padding: 1.35rem 1.35rem 1.5rem;
}

.bo-panel-section__title {
  margin: 0 0 0.5rem;
  font-family: var(--bo-heading-font);
  font-size: var(--bo-heading-size);
  font-weight: var(--bo-heading-weight);
  color: var(--bo-heading-color);
  letter-spacing: var(--bo-heading-letter);
}

.bo-form-grid {
  display: grid;
  gap: 0.85rem 1.25rem;
}

.bo-form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .bo-form-grid--2 {
    grid-template-columns: 1fr;
  }
}

.bo-form-span-2 {
  grid-column: 1 / -1;
}

.bo-form-span-3 {
  grid-column: 1 / -1;
}

.bo-form-row--checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

.bo-form-row--toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.1rem;
}

.bo-form-row--toggle .bo-form-row__label-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

/* NIF + Activo: 3 colunas; NIF na 1.ª (largura alinhada a País), Activo na 2.ª, 3.ª vazia */
.bo-form-row--nif-active {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto;
  gap: 0.35rem 1.25rem;
  align-items: start;
}

.bo-form-row--nif-active > label {
  grid-column: 1;
  grid-row: 1;
}

.bo-form-row--nif-active > .bo-nif-active__label-act {
  grid-column: 2;
  grid-row: 1;
}

.bo-form-row--nif-active > .bo-nif-active__cell-input {
  grid-column: 1;
  grid-row: 2;
}

.bo-form-row--nif-active > .bo-nif-active__cell-toggle {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  align-self: center;
}

.bo-nif-active__label-act {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.bo-nif-active__cell-input,
.bo-nif-active__cell-toggle {
  min-width: 0;
  display: flex;
  align-items: center;
}

.bo-nif-input-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.bo-form-premium .bo-nif-input {
  width: 100%;
  max-width: 100%;
  padding-right: 2.65rem;
}

.bo-nif-input__lookup {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.bo-nif-input__lookup:hover {
  background: #f1f5f9;
  color: var(--zswms-accent);
}

.bo-nif-input__lookup:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35);
}

@media (max-width: 720px) {
  .bo-form-row--nif-active {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .bo-form-row--nif-active > label {
    order: 1;
  }
  .bo-nif-active__cell-input {
    order: 2;
  }
  .bo-nif-active__label-act {
    order: 3;
  }
  .bo-nif-active__cell-toggle {
    order: 4;
  }
}

.bo-form-premium .bo-form-row label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.bo-form-premium .bo-form-row input[type="text"],
.bo-form-premium .bo-form-row input[type="email"],
.bo-form-premium .bo-form-row input[type="password"],
.bo-form-premium .bo-form-row input[type="number"],
.bo-form-premium .bo-form-row input[type="url"],
.bo-form-premium .bo-form-row input.bo-smartinput,
.bo-form-premium .bo-form-row textarea,
.bo-form-premium .bo-form-row select {
  max-width: none;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.bo-form-premium .bo-form-row input:focus,
.bo-form-premium .bo-form-row input.bo-smartinput:focus,
.bo-form-premium .bo-form-row textarea:focus,
.bo-form-premium .bo-form-row select:focus {
  outline: none;
  border-color: var(--zswms-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.bo-form-premium .bo-form-row textarea {
  min-height: 90px;
  font-family: inherit;
}

.bo-actions--end {
  justify-content: flex-end;
  margin-top: 1.35rem;
}

/* Abas */
.bo-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.15rem;
}

.bo-tabbar--pills .bo-tabbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.bo-tabbar--pills .bo-tabbar__btn:hover {
  color: #0f172a;
  border-color: #cbd5e1;
}

.bo-tabbar--pills .bo-tabbar__btn.is-active {
  background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
  color: #fff;
  border-color: transparent;
}

/* Parceiro: tabs + painel — alinhado ao cartão da lista, barra clara */
.bo-partner-tabbed {
  margin-top: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--zswms-card);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

/* Empresas (company_edit): mesmo bloco ST que parceiro — Geral|API|Lojas + acções na barra superior */
.bo-partner-tabbed--company-page {
  width: 100%;
}

.bo-partner-tabbed--tenant-modal--no-inner-bar .bo-partner-tabbed__panels--tenant-modal {
  padding-top: 0.45rem;
}

.bo-partner-tabbed__bar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.75rem 0.65rem 0.65rem;
  min-height: 2.75rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.bo-partner-tabbed__bar .bo-tabbar--line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: min(100%, 11rem);
  border: none;
  background: transparent;
}

.bo-partner-tabbed__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0;
}

.bo-partner-tabbed__bar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex: 0 1 auto;
  min-width: 0;
}

.bo-partner-tabbed__bar-title {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 0.5rem 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: -0.02em;
  align-self: center;
}

.bo-partner-tabbed .bo-tabbar--line .bo-tabbar__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.bo-tabbar__btn[hidden] {
  display: none !important;
}

.bo-partner-tabbed .bo-tabbar--line .bo-tabbar__btn:hover {
  color: #0f172a;
  background: #f8fafc;
}

.bo-partner-tabbed .bo-tabbar--line .bo-tabbar__btn.is-active {
  color: #0f172a;
  font-weight: 600;
  background: #f1f5f9;
  border-color: #e2e8f0;
  box-shadow: none;
}

/* Tabs estilo pasta (outros ecrãs; no parceiro prevalecem as regras .bo-partner-tabbed …) */
.bo-tabbar--line .bo-tabbar__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.2rem;
  margin: 0 0.1rem -1px 0;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 0;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.bo-tabbar--line .bo-tabbar__btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.45);
}

.bo-tabbar--line .bo-tabbar__btn.is-active {
  color: #0f172a;
  font-weight: 700;
  background: #fff;
  border-color: #e2e8f0;
  border-bottom: 1px solid #fff;
  border-radius: 10px 10px 0 0;
  padding-top: 0.55rem;
  padding-bottom: 0.7rem;
  margin-bottom: -1px;
  z-index: 1;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.04);
}

.bo-partner-tabbed__panels {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.bo-partner-tabbed__panels > .bo-card.bo-form-panel {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.bo-partner-tabbed__panels > .bo-card .bo-form-panel__head {
  border-radius: 0;
}

@media (max-width: 560px) {
  .bo-tabbar--line .bo-tabbar__btn {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    font-size: 0.82rem;
  }

  .bo-partner-tabbed__actions {
    width: 100%;
    justify-content: flex-end;
    padding-bottom: 0.35rem;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    padding-top: 0.35rem;
    margin-top: 0.15rem;
  }
}

/* Tabela premium */
.bo-table--premium th {
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #334155;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #cbd5e1;
}

.bo-table--premium td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
}

.bo-table--premium tbody tr:hover td {
  background: #f8fafc;
}

.bo-table__col-actions {
  width: 7rem;
  text-align: right;
}

.bo-cell-partner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.bo-cell-partner__dot {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  flex-shrink: 0;
}

.bo-cell-partner__text {
  min-width: 0;
}

.bo-cell-partner__text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--zswms-text);
}

.bo-cell-partner__slug {
  display: block;
  font-size: 0.78rem;
  color: var(--zswms-muted);
  margin-top: 0.15rem;
}

.bo-badge--pill {
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-weight: 600;
}

.bo-icon-actions {
  display: inline-flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

.bo-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
  border: 1px solid #e2e8f0;
  background: #fff;
  transition: background 0.15s, border-color 0.15s;
}

.bo-icon-btn:hover {
  background: #f1f5f9;
  border-color: var(--zswms-accent);
}

.bo-icon-btn--edit {
  color: #0284c7;
}

.bo-icon-btn--users {
  color: #4f46e5;
}

/* Parceiros: layout master–detail + toasts */
.bo-partner-shell {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  flex: 1;
  min-height: 0;
  margin-top: -0.25rem;
}

.bo-partner-shell--solo {
  flex-direction: column;
}

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

.bo-partner-side {
  width: 17.5rem;
  flex-shrink: 0;
  align-self: stretch;
  background: var(--zswms-card);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bo-partner-side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.bo-partner-side__head-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--zswms-muted);
  min-width: 0;
}

.bo-partner-side__toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.bo-partner-side__toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.bo-partner-side__toggle-track {
  display: block;
  width: 2.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
  position: relative;
}

.bo-partner-side__toggle-thumb {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.bo-partner-side__toggle-input:checked + .bo-partner-side__toggle-track {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.bo-partner-side__toggle-input:checked + .bo-partner-side__toggle-track .bo-partner-side__toggle-thumb {
  transform: translateX(1rem);
}

.bo-partner-side__toggle-input:focus-visible + .bo-partner-side__toggle-track {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35);
}

.bo-partner-side__search {
  padding: 0.65rem 0.75rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.bo-partner-side__search-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--zswms-text);
}

.bo-partner-side__search-input:focus {
  outline: none;
  border-color: var(--zswms-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.bo-partner-side__search-input::placeholder {
  color: #94a3b8;
}

.bo-partner-side__empty {
  margin: 0.5rem 0.35rem;
  padding: 0.5rem;
  font-size: 0.82rem;
  color: var(--zswms-muted);
  line-height: 1.35;
}

.bo-partner-side__link.is-partner-filtered-out {
  display: none !important;
}

.bo-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bo-partner-side__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem 0.5rem 0.75rem;
  min-height: 0;
}

.bo-partner-side__link {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--zswms-text);
  font-size: 0.88rem;
  line-height: 1.3;
  border: 1px solid transparent;
}

.bo-partner-side__link:hover {
  background: #f1f5f9;
}

.bo-partner-side__link.is-active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.12) 0%, rgba(14, 165, 233, 0.02) 100%);
  border-color: #bae6fd;
  box-shadow: 0 1px 0 rgba(14, 165, 233, 0.15);
}

.bo-partner-side__name {
  font-weight: 600;
  display: block;
}

.bo-partner-side__meta {
  display: block;
  font-size: 0.75rem;
  color: var(--zswms-muted);
  margin-top: 0.2rem;
}

.bo-partner-side__badge {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}

.bo-partner-side__badge--on {
  background: #e6f7ed;
  color: #0d6832;
}

.bo-partner-side__badge--off {
  background: #f1f5f9;
  color: #64748b;
}

.bo-partner-main {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bo-partner-main__status {
  background: var(--zswms-card);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bo-partner-main__status:empty {
  display: none;
}

.bo-partner-main__status--err {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.bo-partner-main__status--info {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #075985;
}

.bo-partner-main__status[hidden] {
  display: none !important;
}

.bo-toast-stack {
  position: fixed;
  left: 50%;
  bottom: 1.35rem;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  pointer-events: none;
  max-width: min(32rem, calc(100vw - 2rem));
}

.bo-toast {
  pointer-events: none;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.bo-toast.is-in {
  opacity: 1;
  transform: translateY(0);
}

.bo-toast--ok {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
}

.bo-toast--err {
  background: #7f1d1d;
  color: #fef2f2;
  border: 1px solid #991b1b;
}

.bo-partner-toolbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* [hidden] deve ganhar ao display:inline-flex da toolbar (modo «Nova empresa»: só Gravar) */
#bo-ce-toolbar-new[hidden],
#bo-ce-toolbar-delete[hidden] {
  display: none !important;
}

.bo-partner-toolbar__btn--icon {
  gap: 0;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  min-width: 2.35rem;
  justify-content: center;
  transition: gap 0.18s ease, padding 0.18s ease;
}

.bo-partner-toolbar__btn--icon .bo-partner-toolbar__text {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.22s ease, opacity 0.15s ease;
}

.bo-partner-toolbar__btn--icon:hover,
.bo-partner-toolbar__btn--icon:focus-visible {
  gap: 0.4rem;
  padding-left: 0.65rem;
  padding-right: 0.75rem;
}

.bo-partner-toolbar__btn--icon:hover .bo-partner-toolbar__text,
.bo-partner-toolbar__btn--icon:focus-visible .bo-partner-toolbar__text {
  max-width: 15rem;
  opacity: 1;
}

.bo-partner-toolbar__btn .bo-partner-toolbar__icon {
  flex-shrink: 0;
}

.bo-offscreen-form {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bo-partner-tabbed .bo-tabbar--line button.bo-tabbar__btn {
  cursor: pointer;
  font: inherit;
  font-family: inherit;
}

.bo-smtp-info-wrap {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  max-width: 100%;
  min-width: 0;
}

#bo-pt-panel-commercial .bo-form-row > .bo-pt-commercial-field-label {
  margin-bottom: 0.35rem;
  width: 100%;
}

#bo-pt-panel-commercial .bo-pt-commercial-margin-out[readonly] {
  background: #f1f5f9;
  color: #475569;
  cursor: default;
}

.bo-partner-tab-panel-head.bo-smtp-info-wrap {
  margin-bottom: 1rem;
  width: 100%;
}

.bo-smtp-info-btn {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.bo-smtp-info-btn:hover,
.bo-smtp-info-btn:focus-visible {
  color: #0f172a;
  background: #e2e8f0;
  border-color: #cbd5e1;
  outline: none;
}

.bo-smtp-info-tip {
  display: none;
  flex-basis: 100%;
  margin: 0 0 0.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.bo-smtp-info-tip.is-open {
  display: block;
}

.bo-smtp-info-tip--multiline {
  max-width: 100%;
}

/* SMARTTEMPLATE — padrão reutilizável: grelhas, .bo-smartinput, pesquisa (estender noutros ecrãs) */
.bo-smarttemplate {
  margin-top: 0.1rem;
}

.bo-smarttemplate__grid--host-port {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6rem, 8rem);
  gap: 0.85rem 1.25rem;
  align-items: start;
  margin-bottom: 0.85rem;
}

@media (max-width: 720px) {
  .bo-smarttemplate__grid--host-port {
    grid-template-columns: 1fr;
  }
}

.bo-smarttemplate__actions--smtp-test {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
  padding-top: 0.85rem;
}

.bo-smarttemplate__actions--smtp-test .bo-form-row {
  flex: 1 1 14rem;
  min-width: min(100%, 14rem);
  margin: 0;
}

.bo-smarttemplate__actions-buttons {
  flex: 0 0 auto;
  padding-bottom: 0.15rem;
}

.bo-smtp-test-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.65rem;
  padding: 0.55rem 1.15rem 0.55rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(14, 165, 233, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.bo-smtp-test-btn:hover {
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.28), 0 0 0 1px rgba(14, 165, 233, 0.2);
}

.bo-smtp-test-btn:active {
  transform: translateY(1px);
}

.bo-smtp-test-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35), 0 2px 8px rgba(14, 165, 233, 0.2);
}

.bo-smtp-test-btn__icon {
  flex-shrink: 0;
  display: block;
}

.bo-smtp-test-btn__text {
  line-height: 1.2;
}

.bo-smtp-test-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

@media (max-width: 920px) {
  .bo-partner-shell {
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .bo-partner-side {
    width: 100%;
    max-height: 14rem;
    align-self: stretch;
  }

  .bo-partner-main {
    flex: 1;
    min-height: 0;
  }
}

/* Parceiro — utilizadores: modal e tabela ordenável */
body.bo-modal-open {
  overflow: hidden;
}

.bo-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: auto;
}

.bo-modal[hidden] {
  display: none !important;
}

.bo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

.bo-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 34rem);
  max-height: calc(100vh - 3rem);
  overflow: auto;
  background: var(--zswms-card);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

/* Modal utilizador parceiro — ST: largura para grelha 2–3 colunas */
.bo-modal__dialog--partner-user {
  width: min(100%, 52rem);
}

.bo-modal__dialog--online-presence {
  width: min(100%, 64rem);
}

/* Modal empresa (parceiro): separadores Geral / API / Lojas */
.bo-modal__dialog--partner-tenant {
  width: min(100%, 58rem);
  max-height: min(calc(100vh - 1.25rem), 940px);
}

/* Mais área útil antes de aparecer scroll no diálogo */
#bo-partner-tenant-modal.bo-modal {
  padding: 1rem 0.65rem;
}

.bo-modal__dialog--partner-tenant .bo-modal__head {
  padding: 0.6rem 0.85rem 0.4rem;
}

.bo-modal__dialog--partner-tenant .bo-modal__body {
  padding: 0.5rem 0.65rem 0.55rem;
}

.bo-modal__dialog--partner-tenant .bo-modal__foot {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

/* Modal empresa: barra + conteúdo no mesmo cartão ST (como ficha parceiro) */
.bo-partner-tabbed--tenant-modal {
  margin: 0 0 0.4rem;
  flex: 0 1 auto;
  min-height: 0;
}

.bo-partner-tabbed--tenant-modal .bo-partner-tabbed__actions--pt-page {
  align-items: center;
}

#bo-partner-companies-root[data-company-page="1"] > .bo-form-panel__body--company-tenant-only {
  padding: 0;
}

#bo-partner-companies-root[data-company-page="1"] > .bo-form-panel__body--company-tenant-only .bo-company-tenant-inline {
  width: 100%;
}

/* Empresas (página): sem segundo cartão ST em volta de Geral|API|Lojas — só o painel branco exterior */
#bo-partner-companies-root[data-company-page="1"] .bo-partner-tabbed.bo-partner-tabbed--tenant-modal {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  margin: 0;
}

/* Loja: mesmo cartão / espaçamento que modal utilizador; z-index acima da modal empresa */
.bo-modal.bo-modal--nested {
  z-index: 12100;
}

/* Form empresa dentro do painel: barra Geral|API|Lojas colada ao cartão interior ST */
.bo-partner-tabbed__panels .bo-partner-tabbed--tenant-modal {
  margin-top: 0;
}

.bo-partner-tabbed--tenant-modal .bo-partner-tabbed__bar {
  padding: 0.3rem 0.45rem 0.3rem 0.35rem;
  min-height: 0;
}

.bo-partner-tabbed--tenant-modal .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn {
  padding: 0.35rem 0.72rem;
}

.bo-partner-tabbed--tenant-modal .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn.is-active {
  padding-top: 0.42rem;
  padding-bottom: 0.52rem;
}

.bo-partner-tabbed__panels--tenant-modal {
  padding: 0.35rem 0.55rem 0.5rem;
  flex: 0 1 auto;
  min-height: 0;
  overflow: visible;
}

.bo-partner-tabbed__panels--tenant-modal .bo-pt-panel > .bo-partner-tab-panel-head:first-child {
  margin-top: 0;
}

.bo-partner-tabbed__panels--tenant-modal .bo-partner-tab-panel-head.bo-smtp-info-wrap {
  margin-bottom: 0.4rem;
}

.bo-partner-tabbed__panels--tenant-modal .bo-form-grid {
  gap: 0.5rem 0.95rem;
}

.bo-modal__dialog--partner-tenant .bo-form-premium .bo-form-row input[type="text"],
.bo-modal__dialog--partner-tenant .bo-form-premium .bo-form-row input[type="email"],
.bo-modal__dialog--partner-tenant .bo-form-premium .bo-form-row input[type="password"],
.bo-modal__dialog--partner-tenant .bo-form-premium .bo-form-row input[type="number"],
.bo-modal__dialog--partner-tenant .bo-form-premium .bo-form-row input[type="url"],
.bo-modal__dialog--partner-tenant .bo-form-premium .bo-form-row input.bo-smartinput,
.bo-modal__dialog--partner-tenant .bo-form-premium .bo-form-row textarea,
.bo-modal__dialog--partner-tenant .bo-form-premium .bo-form-row select {
  padding: 0.52rem 0.75rem;
  font-size: 0.9rem;
}

.bo-partner-tabbed__panels--tenant-modal #bo-pt-stores-toolbar {
  margin-top: 0.2rem;
}

.bo-partner-tabbed__panels--tenant-modal .bo-table-wrap--partner-users {
  margin-top: 0.45rem;
}

/* Bloco «nova/editar loja» só no separador Lojas (contraste com a grelha); na modal de loja ver #bo-pt-store-modal */
.bo-partner-tabbed__panels--tenant-modal #bo-pt-store-inline-new {
  margin-top: 0.5rem;
  padding: 0.55rem;
  background: rgba(241, 245, 249, 0.9);
  border-radius: 8px;
}

/* Modal editar loja: fundo branco como modal utilizador (o ID acima também matcha dentro da modal aninhada) */
#bo-pt-store-modal #bo-pt-store-inline-new {
  margin-top: 0;
  padding: 0;
  background: #fff;
  border-radius: 0;
}

.bo-partner-tabbed__panels--tenant-modal #bo-pt-store-inline-new .bo-pt-store-inline-new__title {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.bo-partner-tabbed__panels--tenant-modal #bo-pt-store-inline-new .bo-pt-store-inline-new__title--with-info {
  margin: 0;
}

.bo-partner-tabbed__panels--tenant-modal #bo-pt-store-inline-new .bo-pt-store-inline-new__section-head.bo-smtp-info-wrap {
  margin-top: 0.5rem;
  margin-bottom: 0.4rem;
  width: 100%;
}

.bo-partner-tabbed__panels--tenant-modal #bo-pt-store-inline-new .bo-pt-store-inline-new__head-dados.bo-smtp-info-wrap {
  margin-top: 0;
}

.bo-partner-tabbed__panels--tenant-modal #bo-pt-store-inline-new .bo-pt-store-inline-new__actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bo-partner-tabbed__panels--tenant-modal #bo-pt-store-inline-new .bo-pt-store-inline-new__grid-3 {
  align-items: start;
}

.bo-partner-tabbed__panels--tenant-modal #bo-pt-store-inline-new .bo-pt-store-inline-new__col-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: 0;
}

.bo-partner-tabbed__panels--tenant-modal .bo-th-narrow {
  width: 5.5rem;
  white-space: nowrap;
}

.bo-partner-tabbed__panels--tenant-modal .bo-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Modal empresa — segredo API: olho para mostrar/ocultar */
.bo-pt-secret-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.bo-modal__dialog--partner-tenant .bo-pt-secret-wrap .bo-pt-secret-input {
  width: 100%;
  max-width: 100%;
  padding-right: 2.65rem;
}

.bo-pt-secret-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.bo-pt-secret-toggle:hover,
.bo-pt-secret-toggle:focus-visible {
  color: var(--zswms-accent);
  background: #f1f5f9;
  outline: none;
}

.bo-pt-secret-toggle__eye-off {
  display: none;
}

.bo-partner-tabbed--tenant-modal .bo-partner-tabbed__actions {
  align-items: center;
}

.bo-partner-tabbed--tenant-modal .bo-partner-tabbed__actions .bo-pt-api-test-btn {
  white-space: nowrap;
}

/* Só o separador API mostra o teste; [hidden] + jQuery .hide() */
.js-bo-pt-api-test[hidden] {
  display: none !important;
}

.bo-partner-tabbed__panels--tenant-modal > .bo-pt-panel > .bo-hint:first-child {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.bo-pu-modal-form.bo-form-premium .bo-pu-modal-grid-main {
  margin-bottom: 0.25rem;
}

.bo-pu-modal-section {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.bo-pu-modal-hint {
  margin: 0 0 0.5rem;
}

.bo-pu-modal-form .bo-pu-store-field .bo-pu-store-filter {
  margin-bottom: 0.45rem;
}

/* Modal utilizador / edição: Activo — rótulo por cima do switch */
.bo-pu-modal-field-active {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding-top: 0.1rem;
}

.bo-pu-modal-field-active .bo-form-row__label-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.bo-pu-modal-grid-main > .bo-pu-modal-field-active {
  align-self: start;
}

.bo-form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .bo-form-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .bo-form-grid--3 {
    grid-template-columns: 1fr;
  }
}

/* Definições PWA — secção Cores: presets + 3 pickers numa única linha (desktop) */
.bo-form-grid--pwa-colors {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.bo-form-grid--pwa-colors .bo-pwa-color-presets {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.bo-form-grid--pwa-colors .bo-pwa-color-presets .bo-btn {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.bo-form-grid--pwa-colors .bo-color-field {
  flex-wrap: nowrap;
  min-width: 0;
}

@media (max-width: 1100px) {
  .bo-form-grid--pwa-colors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bo-form-grid--pwa-colors .bo-pwa-color-presets {
    flex-wrap: wrap;
  }

  .bo-form-grid--pwa-colors .bo-pwa-color-presets .bo-btn {
    flex: 1 1 auto;
    font-size: inherit;
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .bo-form-grid--pwa-colors {
    grid-template-columns: 1fr;
  }
}

.bo-pu-checkboxes--modal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
  align-content: start;
}

@media (min-width: 900px) {
  .bo-pu-checkboxes--modal {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .bo-pu-checkboxes--modal {
    grid-template-columns: 1fr;
  }
}

.bo-pu-fieldset .bo-pu-stock-grid {
  margin-top: 0.35rem;
}

/* Modal parceiro — empresas: multi-select ST (tags + lista, alinhado a inputs premium) */
.bo-pu-modal-form .bo-form-row .bo-st-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.bo-pu-modal-form .bo-st-ms {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bo-pu-modal-form .bo-st-ms:focus-within {
  outline: none;
  border-color: var(--zswms-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* Tags numa linha; filtro na linha seguinte — largura total do select (edge-to-edge no padding) */
.bo-pu-modal-form .bo-st-ms__top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.bo-pu-modal-form .bo-st-ms__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  width: 100%;
  min-width: 0;
  min-height: 1.5rem;
}

.bo-pu-modal-form .bo-st-ms__tags:empty::before {
  content: attr(data-placeholder);
  font-size: 0.88rem;
  line-height: 1.35;
  color: #94a3b8;
}

/* Input de filtro = mesma “faixa” que bo-smartinput: 100% da largura útil, desde o início */
.bo-pu-modal-form .bo-st-ms__filter {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #334155;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bo-pu-modal-form .bo-st-ms__filter::placeholder {
  color: #94a3b8;
}

.bo-pu-modal-form .bo-st-ms__filter:hover {
  border-color: #cbd5e1;
}

.bo-pu-modal-form .bo-st-ms__filter:focus {
  outline: none;
  border-color: var(--zswms-accent);
  /* Anel do contentor .bo-st-ms:focus-within; evitar dupla sombra */
  box-shadow: none;
}

.bo-pu-modal-form .bo-st-ms__empty {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #94a3b8;
}

.bo-pu-modal-form .bo-st-ms__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  max-width: 100%;
  padding: 0.2rem 0.45rem 0.2rem 0.3rem;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.bo-pu-modal-form .bo-st-ms__tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14rem;
}

.bo-pu-modal-form .bo-st-ms__tag-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 1.05rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.bo-pu-modal-form .bo-st-ms__tag-remove:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.08);
}

.bo-pu-modal-form .bo-st-ms__list {
  max-height: 11rem;
  overflow-y: auto;
  padding: 0.2rem 0;
}

.bo-pu-modal-form .bo-st-ms__opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.85rem;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #334155;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.bo-pu-modal-form .bo-st-ms__opt:hover,
.bo-pu-modal-form .bo-st-ms__opt:focus-visible {
  outline: none;
  background: var(--zswms-accent);
  color: #fff;
}

.bo-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.bo-modal__title {
  margin: 0;
  font-family: var(--bo-heading-font);
  font-size: var(--bo-heading-size);
  font-weight: var(--bo-heading-weight);
  color: var(--bo-heading-color);
  letter-spacing: var(--bo-heading-letter);
}

.bo-modal__close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--zswms-muted);
  padding: 0.25rem 0.4rem;
}

.bo-modal__body {
  padding: 1rem;
}

.bo-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* Utilizadores do parceiro — ST (SMARTTEMPLATE): barra pesquisa + estado + acção primária */
#bo-partner-users-root .bo-form-panel__body--partner-users {
  padding-top: 1.35rem;
  padding-bottom: 1.5rem;
}

#bo-partner-users-root .bo-partner-tab-panel-head.bo-smtp-info-wrap {
  margin-bottom: 0;
}

.bo-smarttemplate--partner-users {
  margin-top: 0;
  margin-bottom: 0;
}

/* Alinhado a .bo-smarttemplate__actions--smtp-test: mesma linha de base, gap e botão de acção */
.bo-smarttemplate__toolbar--partner-users {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 0.35rem;
}

.bo-smarttemplate--partner-users .bo-st-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.bo-smarttemplate--partner-users .bo-st-field--search {
  flex: 1 1 14rem;
  max-width: 28rem;
}

.bo-smarttemplate--partner-users .bo-st-field--status {
  flex: 0 0 auto;
}

.bo-smarttemplate--partner-users .bo-st-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.bo-smarttemplate__toolbar--partner-users .bo-smarttemplate__actions-buttons {
  flex: 0 0 auto;
  padding-bottom: 0.15rem;
  margin-left: auto;
}

/* Botão primário ST: mesma “pegada” que o teste SMTP (altura, raio, sombra) */
.bo-st-partner-new.bo-btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.55rem 1.15rem 0.55rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.bo-st-partner-new.bo-btn--primary:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.bo-st-partner-new.bo-btn--primary:active {
  transform: translateY(1px);
}

.bo-st-partner-new.bo-btn--primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35), 0 2px 8px rgba(14, 165, 233, 0.2);
}

/* Lista empresas no parceiro: só ícone +, tooltip via title (i18n) */
.bo-st-partner-new-icon.bo-btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  min-width: 2.65rem;
  padding: 0.5rem;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.bo-st-partner-new-icon.bo-btn--primary:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.bo-st-partner-new-icon.bo-btn--primary:active {
  transform: translateY(1px);
}

.bo-st-partner-new-icon.bo-btn--primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35), 0 2px 8px rgba(14, 165, 233, 0.2);
}

/* SMARTTEMPLATE: filtro Estado — segmentos (toggle) */
.bo-segmented {
  display: inline-flex;
  align-items: stretch;
  flex-wrap: nowrap;
  padding: 3px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.bo-segmented--partner-users {
  min-width: 0;
  min-height: 2.65rem;
  align-items: center;
}

.bo-segmented__btn {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.bo-segmented__btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.5);
}

.bo-segmented__btn.is-active {
  color: #0f172a;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(14, 165, 233, 0.15);
}

.bo-segmented__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.45);
}

.bo-segmented__btn.is-active:focus-visible {
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.45), 0 1px 3px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(14, 165, 233, 0.15);
}

.bo-smarttemplate--partner-users .bo-st-field--search .bo-smartinput.bo-st-input-search {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.65rem 0.85rem;
  min-height: 2.65rem;
  font: inherit;
  font-size: 0.95rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--zswms-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bo-smarttemplate--partner-users .bo-st-field--search .bo-smartinput.bo-st-input-search::placeholder {
  color: #94a3b8;
}

.bo-smarttemplate--partner-users .bo-st-field--search .bo-smartinput.bo-st-input-search:focus {
  outline: none;
  border-color: var(--zswms-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.bo-table-wrap--partner-users {
  margin-top: 0;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.02);
  overflow: hidden;
}

.bo-table-wrap--partner-users .bo-table--partner-users {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.bo-table-wrap--partner-users .bo-table--partner-users thead th {
  background: linear-gradient(180deg, #f8fafc 0%, #e8eef5 100%);
  color: #334155;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  font-weight: 700;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.5);
  vertical-align: middle;
}

.bo-table-wrap--partner-users .bo-table--partner-users tbody td {
  padding: 0.75rem 0.9rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
}

.bo-table-wrap--partner-users .bo-table--partner-users tbody tr:hover td {
  background: #f8fafc;
}

.bo-table-wrap--partner-users .bo-table--partner-users tbody tr:last-child td {
  border-bottom: none;
}

.bo-table-wrap--partner-users .bo-th-status {
  text-align: center;
  width: 4.5rem;
}

.bo-table-wrap--partner-users .bo-th--icon-only {
  width: 3rem;
  text-align: center;
}

/* Tabela «Empresas» (parceiro): colunas compactas, sem buracos entre nome e números */
.bo-table-wrap--partner-users .bo-table--partner-companies {
  table-layout: fixed;
  width: 100%;
}

.bo-table-wrap--partner-users .bo-table--partner-companies col.bo-col-company-name {
  width: 34%;
}

.bo-table-wrap--partner-users .bo-table--partner-companies col.bo-col-nif {
  width: 9rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies col.bo-col-num {
  width: 6.25rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies col.bo-col-status {
  width: 5rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies col.bo-col-actions {
  width: 3.75rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies thead th {
  padding: 0.65rem 0.9rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies tbody td {
  padding: 0.75rem 0.9rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-th-company-name {
  text-align: left;
  vertical-align: middle;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-th-company-name .bo-th-sort {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-th-num {
  text-align: right;
  vertical-align: middle;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-th-num .bo-th-sort {
  display: block;
  width: 100%;
  padding: 0;
  text-align: right;
  white-space: nowrap;
  font-size: 0.72rem;
  line-height: 1.3;
  letter-spacing: 0.045em;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-th-nif {
  text-align: center;
  vertical-align: middle;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-th-nif .bo-th-sort {
  display: block;
  width: 100%;
  padding: 0;
  text-align: center;
  white-space: nowrap;
  font-size: 0.72rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-td-company-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-td-nif {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-th-status .bo-th-sort {
  padding: 0;
  font-size: 0.72rem;
  letter-spacing: 0.045em;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-td-active {
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

.bo-table-wrap--partner-users .bo-table--partner-companies .bo-td-actions {
  width: auto;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

.bo-table-wrap--partner-users .bo-td-active {
  text-align: center;
  vertical-align: middle;
}

.bo-partner-users-active-cell {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  cursor: pointer;
  margin: 0;
}

.bo-partner-users-active-cell .bo-partner-side__toggle-track {
  transform: scale(0.92);
  transform-origin: center;
}

.bo-table-wrap--partner-users .bo-td-actions {
  text-align: right;
  vertical-align: middle;
  width: 3rem;
}

/* SMARTTEMPLATE: botão editar (ícone) na tabela de utilizadores */
.bo-partner-users-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(14, 165, 233, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.bo-partner-users-edit-btn:hover {
  color: var(--zswms-accent);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.28), 0 0 0 1px rgba(14, 165, 233, 0.2);
}

.bo-partner-users-edit-btn:active {
  transform: translateY(1px);
}

.bo-partner-users-edit-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35), 0 2px 8px rgba(14, 165, 233, 0.2);
}

.bo-partner-users-edit-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.bo-partner-users-edit-btn__icon svg {
  display: block;
}

.bo-table-wrap--partner-users .bo-th-sort {
  font-weight: 700;
  letter-spacing: 0.045em;
  color: #475569;
}

.bo-table-wrap--partner-users .bo-th-sort__static {
  font-weight: 700;
  letter-spacing: 0.045em;
  color: #475569;
}

@media (max-width: 640px) {
  .bo-smarttemplate__toolbar--partner-users {
    flex-direction: column;
    align-items: stretch;
  }

  .bo-smarttemplate--partner-users .bo-st-field--search {
    max-width: none;
  }

  .bo-smarttemplate__toolbar--partner-users .bo-smarttemplate__actions-buttons {
    align-self: flex-end;
  }

  .bo-segmented--partner-users {
    width: 100%;
    justify-content: stretch;
  }

  .bo-segmented--partner-users .bo-segmented__btn {
    flex: 1 1 33%;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    font-size: 0.74rem;
  }
}

.bo-th-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: inherit;
  cursor: pointer;
  padding: 0.15rem 0;
  text-align: left;
}

.bo-th-sort:hover {
  color: var(--zswms-accent);
}

.bo-th-sort__ind {
  font-size: 0.65rem;
  opacity: 0.65;
}

.bo-th-sort__static {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bo-table__empty-filter {
  color: var(--zswms-muted);
  text-align: center;
  padding: 1rem !important;
}

.bo-pu-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bo-pu-check-label {
  display: block;
  cursor: pointer;
}

.bo-pu-fieldset {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0.5rem 0 0;
}

.bo-form-error {
  color: #b91c1c;
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.bo-company-tenant-inline {
  margin-top: 0;
}

/* ST (SmartTemplate): regra global para aproveitar melhor ecrãs largos. */
.zswms-main:has(.bo-partner-tabbed--st) {
  max-width: none;
}

@media (min-width: 1440px) {
  .zswms-main .bo-partner-tabbed--st > .bo-partner-tabbed__panels .bo-form-grid--2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1rem;
  }

  /* Parceiros > Geral: grelhas que devem ficar em 2 colunas 50/50 (a regra ST acima usa 3 colunas). */
  .zswms-main .bo-partner-tabbed--st > .bo-partner-tabbed__panels .bo-form-grid--2.bo-partner-general-grid,
  .zswms-main .bo-partner-tabbed--st > .bo-partner-tabbed__panels .bo-form-grid--2.bo-partner-geo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* API: ID cliente + chave (linha 1) e caminho doc + doc sem versão (linha 4) em 2 colunas 50/50.
     A regra ST acima (4 classes) ganhava a .bo-company-tenant-inline (3 classes); #bo-partner-companies-root garante na página Empresas. */
  #bo-partner-tenant-modal .bo-pt-api-grid-credentials.bo-form-grid--2,
  .bo-company-tenant-inline .bo-pt-api-grid-credentials.bo-form-grid--2,
  #bo-partner-companies-root .bo-pt-api-grid-credentials.bo-form-grid--2,
  #bo-partner-tenant-modal .bo-pt-api-grid-docpair.bo-form-grid--2,
  .bo-company-tenant-inline .bo-pt-api-grid-docpair.bo-form-grid--2,
  #bo-partner-companies-root .bo-pt-api-grid-docpair.bo-form-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bo-pt-api-grid-rest {
  margin-top: 0.85rem;
}

/* Bloco caminho documentos + doc sem versão: mesma linha 50/50; ocupa toda a largura da grelha ST (3 col). */
.bo-pt-api-grid-rest > .bo-pt-api-grid-docpair-wrap {
  grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   ST (SmartTemplate): separadores em pastilha — igual ao ecrã Parceiros.
   Em .bo-partner-shell, Definições (.bo-settings-tabbed) e shells com ID,
   anula o estilo global “pasta” (.bo-tabbar--line) e uniformiza <a>, <button> e <span>. */
.bo-partner-shell .bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn,
.bo-settings-tabbed.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn,
#bo-store-edit-legacy-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn,
#bo-stores-list-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn,
#bo-tenant-edit-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  margin: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  box-shadow: none;
}

.bo-partner-shell .bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line button.bo-tabbar__btn,
.bo-settings-tabbed.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line button.bo-tabbar__btn,
#bo-store-edit-legacy-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line button.bo-tabbar__btn,
#bo-stores-list-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line button.bo-tabbar__btn,
#bo-tenant-edit-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line button.bo-tabbar__btn {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.bo-partner-shell .bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line a.bo-tabbar__btn,
.bo-settings-tabbed.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line a.bo-tabbar__btn,
#bo-store-edit-legacy-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line a.bo-tabbar__btn,
#bo-stores-list-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line a.bo-tabbar__btn,
#bo-tenant-edit-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line a.bo-tabbar__btn {
  cursor: pointer;
}

.bo-partner-shell .bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line span.bo-tabbar__btn,
.bo-settings-tabbed.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line span.bo-tabbar__btn,
#bo-store-edit-legacy-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line span.bo-tabbar__btn,
#bo-stores-list-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line span.bo-tabbar__btn,
#bo-tenant-edit-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line span.bo-tabbar__btn {
  cursor: default;
}

.bo-partner-shell .bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn:hover,
.bo-settings-tabbed.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn:hover,
#bo-store-edit-legacy-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn:hover,
#bo-stores-list-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn:hover,
#bo-tenant-edit-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn:hover {
  color: #0f172a;
  background: #f8fafc;
}

.bo-partner-shell .bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn.is-active,
.bo-settings-tabbed.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn.is-active,
#bo-store-edit-legacy-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn.is-active,
#bo-stores-list-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn.is-active,
#bo-tenant-edit-shell.bo-partner-tabbed--st > .bo-partner-tabbed__bar .bo-tabbar--line .bo-tabbar__btn.is-active {
  color: #0f172a;
  font-weight: 600;
  background: #f1f5f9;
  border-color: #e2e8f0;
  box-shadow: none;
  margin-bottom: 0;
  z-index: auto;
}

/* store_edit.php: mesmo bloco que nova/editar loja (modal/empresa) */
.bo-store-edit-st-form.bo-pt-store-inline-new--page {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.bo-store-edit-st-form.bo-pt-store-inline-new--page .bo-pt-store-inline-new__section-head.bo-smtp-info-wrap {
  margin-top: 0.75rem;
  margin-bottom: 0.4rem;
  width: 100%;
}

.bo-store-edit-st-form.bo-pt-store-inline-new--page .bo-pt-store-inline-new__head-dados.bo-smtp-info-wrap {
  margin-top: 0;
}

.bo-store-edit-st-form.bo-pt-store-inline-new--page .bo-pt-store-inline-new__grid-3 {
  align-items: start;
}

.bo-store-edit-st-form.bo-pt-store-inline-new--page .bo-pt-store-inline-new__col-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: 0;
}

.bo-store-edit-st-form.bo-pt-store-inline-new--page .bo-form-row textarea.bo-smartinput {
  min-height: 10rem;
  min-width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.45;
}

.bo-store-edit__logo-preview {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.bo-store-logo-card.bo-store-edit__logo-preview {
  margin: 0 0 1rem;
  padding: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.bo-store-logo-card--pending-remove .bo-store-logo-card__figure {
  opacity: 0.45;
  filter: grayscale(0.25);
}

.bo-store-logo-card__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fafbfc;
}

.bo-store-logo-card__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
}

.bo-store-logo-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.bo-store-logo-remove-btn:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.bo-store-logo-remove-btn:focus-visible {
  outline: 2px solid #0066b3;
  outline-offset: 2px;
}

.bo-store-logo-card__figure {
  padding: 1rem 1rem 0.75rem;
  text-align: center;
  background: #f8fafc;
}

.bo-store-logo-card__img {
  display: inline-block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 10rem;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.bo-store-logo-card__pending {
  margin: 0;
  padding: 0.5rem 0.85rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
}

.bo-color-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bo-color-field__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bo-color-field__picker-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0.25rem;
}

.bo-color-field__picker-btn:hover {
  border-color: #94a3b8;
}

.bo-color-field__picker-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.bo-color-field__swatch {
  width: 100%;
  height: 100%;
  border-radius: 0.35rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
}

.bo-color-field__hex {
  width: 9rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.bo-store-logo-card__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: stretch;
  padding: 0.75rem 0.85rem 0.85rem;
}

@media (max-width: 36rem) {
  .bo-store-logo-card__body {
    grid-template-columns: 1fr;
  }
}

.bo-store-logo-card__col--preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.bo-store-logo-card__col--upload {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bo-store-logo-card__body .bo-store-logo-card__figure {
  flex: 1 1 auto;
  min-height: 6.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.bo-store-logo-card__figure--empty {
  min-height: 6.5rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.bo-store-logo-card__figure--pwa-shot {
  min-height: 8rem;
}

.bo-store-logo-card__figure--pwa-shot .bo-store-logo-card__img {
  max-height: 11rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.bo-store-logo-card__local.bo-store-edit__logo-preview {
  margin: 0;
}

.bo-form-row--logo-upload--in-card {
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bo-form-row--logo-upload--in-card .bo-store-logo-upload {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 6.5rem;
}

.bo-form-row--logo-upload--in-card .bo-store-logo-upload__surface {
  flex: 1 1 auto;
  min-height: 6rem;
}

.bo-store-edit__logo-preview--local {
  border-color: #93c5fd;
  background: #eff6ff;
}

.bo-store-edit__logo-preview-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.bo-store-edit__logo-img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 10rem;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

/* Upload de logo da loja — zona moderna (clique + arrastar) */
.bo-form-row--logo-upload {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bo-form-row--logo-upload .bo-form-row__label-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.bo-store-logo-upload {
  position: relative;
  display: block;
  border-radius: 10px;
  border: 2px dashed #cbd5e1;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.bo-store-logo-upload:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.bo-store-logo-upload:focus-within {
  outline: 2px solid #0066b3;
  outline-offset: 2px;
}

.bo-store-logo-upload.is-dragover {
  border-color: #0066b3;
  border-style: solid;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.12);
}

.bo-store-logo-upload__input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.bo-store-logo-upload__surface {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 7rem;
  padding: 1.15rem 1rem;
  text-align: center;
  pointer-events: none;
}

.bo-store-logo-upload__icon {
  display: flex;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.bo-store-logo-upload.is-dragover .bo-store-logo-upload__icon {
  color: #0066b3;
}

.bo-store-logo-upload__cta {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  max-width: 22rem;
}

.bo-store-logo-upload.has-file .bo-store-logo-upload__cta {
  display: none;
}

.bo-store-logo-upload__filename {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0066b3;
  word-break: break-all;
  max-width: 100%;
}

.bo-store-logo-upload__sub {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

/* —— Secções colapsáveis (Backoffice global, bo_collapsible.js) —— */
.bo-collapsible {
  margin-bottom: 0.25rem;
}

.bo-collapsible__head.bo-smtp-info-wrap,
.bo-collapsible__head.bo-partner-tab-panel-head {
  margin-bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.5rem 0.75rem;
  min-width: 0;
}

.bo-collapsible__head-main {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  cursor: pointer;
  border-radius: 6px;
  margin: -0.2rem -0.35rem;
  padding: 0.2rem 0.35rem;
  transition: background 0.15s ease;
}

.bo-collapsible__head-main:hover {
  background: rgba(14, 165, 233, 0.08);
}

.bo-collapsible__head-main:focus {
  outline: none;
}

.bo-collapsible__head-main:focus-visible {
  outline: 2px solid var(--zswms-accent);
  outline-offset: 2px;
}

.bo-collapsible__head-main--chart {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.bo-collapsible__chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--zswms-muted);
  margin-top: 0;
}

.bo-collapsible__chevron svg {
  display: block;
  transition: transform 0.2s ease;
}

.bo-collapsible:not(.is-expanded) .bo-collapsible__chevron svg {
  transform: rotate(-90deg);
}

.bo-collapsible__head-actions {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* Tooltip (i) em linha completa abaixo do título — filho directo de .bo-collapsible__head */
.bo-collapsible__head > .bo-smtp-info-tip {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0 0 0.35rem !important;
  text-align: left;
  max-width: 100%;
  min-width: 0;
}

.bo-collapsible:not(.is-expanded) .bo-collapsible__body {
  display: none;
}

.bo-collapsible__body {
  padding-top: 0.35rem;
}

.bo-collapsible__head--chart {
  margin-bottom: 0.35rem;
}

.bo-collapsible__head--billing-dash {
  margin-bottom: 0.5rem;
}

.bo-pdf-layouts__empty {
  text-align: center;
  color: var(--zswms-muted);
}

.bo-modal__dialog--pdf-layout {
  width: min(1440px, calc(100vw - 1.25rem));
  max-width: 1440px;
  max-height: calc(100vh - 1.25rem);
  overflow: hidden;
}

.bo-pdf-layout-editor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: calc(100vh - 8rem);
}

.bo-pdf-layout-editor__toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

.bo-pdf-layout-editor__toolbar-config {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  min-width: 0;
  justify-content: center;
  justify-self: center;
}

.bo-pdf-layout-editor__inline-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--zswms-text);
  font-size: 0.9rem;
}

.bo-pdf-layout-editor__inline-field input[type="number"] {
  width: 3.5em;
}

#bo-pdf-layout-snap-size {
  width: 10ch;
  min-width: 10ch;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  flex: 0 0 auto;
}

.bo-pdf-layout-editor__inline-field input[type="range"] {
  width: 120px;
}

.bo-pdf-layout-editor__history {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.bo-pdf-layout-editor__history-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.bo-pdf-layout-editor__history-btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #0f172a;
}

.bo-pdf-layout-editor__history-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bo-pdf-layout-editor__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  min-width: 0;
}

.bo-pdf-layout-editor__meta-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  position: relative;
}

.bo-pdf-layout-editor__meta-top .bo-smtp-info-tip {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 20;
  min-width: min(22rem, calc(100vw - 3rem));
  max-width: min(28rem, calc(100vw - 3rem));
  margin: 0;
}

.bo-pdf-layout-editor__meta span {
  color: var(--zswms-muted);
  font-size: 0.92rem;
}

.bo-pdf-layout-editor__toolbar-actions {
  display: flex;
  gap: 0.6rem;
  justify-self: end;
  align-self: start;
}

@media (max-width: 1100px) {
  .bo-pdf-layout-editor__toolbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .bo-pdf-layout-editor__toolbar-config,
  .bo-pdf-layout-editor__toolbar-actions {
    justify-self: start;
  }

  .bo-pdf-layout-editor__toolbar-config {
    justify-content: flex-start;
  }
}

.bo-pdf-layout-editor__grid--page {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bo-pdf-layout-editor__grid--page .bo-form-span-2 {
  grid-column: 1 / -1;
}

.bo-pdf-layout-editor__body {
  display: grid;
  grid-template-columns: minmax(680px, 1fr) 420px;
  gap: 1rem;
  align-items: start;
  min-height: 0;
  flex: 1 1 auto;
}

.bo-pdf-layout-editor__stage-wrap {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.bo-pdf-layout-canvas-viewport {
  flex: 1 1 auto;
  min-height: 60vh;
  max-height: calc(100vh - 16rem);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #d7deeb;
  background:
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  padding: 1.25rem;
  display: grid;
  justify-items: center;
  align-items: start;
}

.bo-pdf-layout-editor__legend {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--zswms-muted);
}

.bo-pdf-layout-editor__legend--secondary {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.bo-pdf-layout-canvas {
  position: relative;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  touch-action: none;
}

.bo-pdf-layout-canvas__print-area {
  position: absolute;
  border: 1px dashed rgba(99, 102, 241, 0.65);
  background-color: #fff;
  box-shadow:
    0 0 0 9999px rgba(148, 163, 184, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.15) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.15) 1px, transparent 1px);
}

.bo-pdf-layout-canvas__item {
  position: absolute;
  border: 1px dashed rgba(14, 165, 233, 0.95);
  background: rgba(14, 165, 233, 0.14);
  color: #0f172a;
  padding: 0.22rem 0.35rem;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  border-radius: 6px;
  overflow: hidden;
  font-weight: 600;
  line-height: 1.15;
  user-select: none;
  touch-action: none;
}

.bo-pdf-layout-canvas__row-preview {
  position: absolute;
  border: 1px solid rgba(203, 213, 225, 0.65);
  background: rgba(248, 250, 252, 0.85);
  pointer-events: none;
  color: #64748b;
  font-size: 10px;
  line-height: 1.1;
  padding: 2px 4px;
  overflow: hidden;
}

.bo-pdf-layout-canvas__barcode {
  color: #0f172a;
  align-items: flex-end;
  justify-content: center;
  padding-top: 0.25rem;
  padding-bottom: 0.15rem;
  font-size: 9px;
  line-height: 1;
}

.bo-pdf-layout-canvas__barcode--qr {
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}

.bo-pdf-layout-canvas__item--column {
  background: rgba(148, 163, 184, 0.22);
  border-color: rgba(71, 85, 105, 0.95);
  font-weight: 600;
}

.bo-pdf-layout-canvas__item--line {
  align-items: flex-start;
  justify-content: flex-start;
  color: transparent;
  border-radius: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
}

.bo-pdf-layout-canvas__item--image {
  color: rgba(15, 23, 42, 0.7);
  justify-content: center;
  align-items: center;
}

.bo-pdf-layout-canvas__item.is-selected {
  outline: 3px solid #0284c7;
  z-index: 5;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.18);
}

.bo-pdf-layout-canvas__item.is-hidden {
  opacity: 0.45;
}

.bo-pdf-layout-canvas__item.is-hovered {
  outline: 2px solid #38bdf8;
  z-index: 4;
}

.bo-pdf-layout-canvas__item.is-locked {
  cursor: not-allowed;
  filter: saturate(0.75);
}

.bo-pdf-layout-canvas__selection-box {
  position: absolute;
  border: 1px dashed #0284c7;
  background: rgba(2, 132, 199, 0.12);
  pointer-events: none;
  z-index: 4;
}

.bo-pdf-layout-canvas__resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #0284c7;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(2, 132, 199, 0.25);
}

.bo-pdf-layout-canvas__resize-handle--nw {
  left: -5px;
  top: -5px;
  cursor: nwse-resize;
}

.bo-pdf-layout-canvas__resize-handle--ne {
  right: -5px;
  top: -5px;
  cursor: nesw-resize;
}

.bo-pdf-layout-canvas__resize-handle--sw {
  left: -5px;
  bottom: -5px;
  cursor: nesw-resize;
}

.bo-pdf-layout-canvas__resize-handle--se {
  right: -5px;
  bottom: -5px;
  cursor: nwse-resize;
}

.bo-pdf-layout-canvas__rotate-handle {
  position: absolute;
  left: 50%;
  top: -22px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 999px;
  background: #7c3aed;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.28);
  cursor: grab;
}

.bo-pdf-layout-canvas__rotate-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 10px;
  margin-left: -0.5px;
  background: rgba(124, 58, 237, 0.45);
}

.bo-pdf-layout-editor__sidebar {
  background: #fff;
  border: 1px solid #dbe3f0;
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 16rem);
  overflow: hidden;
}

.bo-pdf-layout-editor__section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bo-pdf-layout-editor__group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.bo-pdf-layout-editor__group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bo-pdf-layout-editor__group-title {
  margin: 0;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bo-pdf-layout-editor__section--checks {
  gap: 0.65rem;
}

.bo-pdf-layout-editor__section--checks-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.bo-pdf-layout-editor__accordion {
  border: 1px solid #dbe3f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  overflow: hidden;
}

.bo-pdf-layout-editor__accordion--page {
  flex: 0 0 auto;
}

.bo-pdf-layout-editor__sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-right: 0.15rem;
}

.bo-pdf-layout-editor__accordion + .bo-pdf-layout-editor__accordion {
  margin-top: 0.1rem;
}

.bo-pdf-layout-editor__accordion-summary {
  list-style: none;
  cursor: pointer;
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bo-pdf-layout-editor__accordion-summary::-webkit-details-marker {
  display: none;
}

.bo-pdf-layout-editor__accordion-summary::after {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform .16s ease;
  margin-top: -0.18rem;
}

.bo-pdf-layout-editor__accordion[open] .bo-pdf-layout-editor__accordion-summary::after {
  transform: rotate(225deg);
  margin-top: 0.12rem;
}

.bo-pdf-layout-editor__accordion-body {
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border-top: 1px solid #e2e8f0;
}

.bo-pdf-layout-editor__section > label,
.bo-pdf-layout-editor__section-head > label,
.bo-pdf-layout-editor .bo-form-row label {
  display: inline-block;
  margin: 0;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.bo-pdf-layout-editor .bo-smartinput,
.bo-pdf-layout-editor input[type="number"],
.bo-pdf-layout-editor input[type="text"],
.bo-pdf-layout-editor select,
.bo-pdf-layout-editor textarea {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.58rem 0.78rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 0.94rem;
  line-height: 1.25;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.bo-pdf-layout-editor select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.4rem;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.bo-pdf-layout-editor textarea {
  min-height: 5.4rem;
  resize: vertical;
}

.bo-pdf-layout-editor .bo-smartinput:focus,
.bo-pdf-layout-editor input[type="number"]:focus,
.bo-pdf-layout-editor input[type="text"]:focus,
.bo-pdf-layout-editor select:focus,
.bo-pdf-layout-editor textarea:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

.bo-pdf-layout-editor .bo-smartinput:hover,
.bo-pdf-layout-editor input[type="number"]:hover,
.bo-pdf-layout-editor input[type="text"]:hover,
.bo-pdf-layout-editor select:hover,
.bo-pdf-layout-editor textarea:hover {
  border-color: #94a3b8;
}

.bo-pdf-layout-editor input[type="color"]:not(.bo-color-field__native) {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.22rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.bo-pdf-layout-editor input[type="range"] {
  accent-color: #9333ea;
}

.bo-pdf-layout-editor__check {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 500;
}

.bo-pdf-layout-editor__check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  border: 1.5px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.bo-pdf-layout-editor__check input[type="checkbox"]::after {
  content: "";
  width: 0.28rem;
  height: 0.52rem;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
  transition: transform .12s ease;
  margin-top: -1px;
}

.bo-pdf-layout-editor__check input[type="checkbox"]:checked {
  background: #9333ea;
  border-color: #9333ea;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.14);
}

.bo-pdf-layout-editor__check input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

.bo-pdf-layout-editor__check input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

.bo-pdf-layout-editor__add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.bo-pdf-layout-editor__elements {
  display: block;
}

.bo-pdf-layout-editor__elements-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.bo-pdf-layout-editor__elements-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.bo-pdf-layout-editor__element-remove {
  color: #64748b;
  font-weight: 700;
}

.bo-pdf-layout-editor__element-dup {
  color: #0369a1;
  font-weight: 700;
}

.bo-pdf-layout-editor__element-dup:hover {
  background: rgba(14, 165, 233, 0.12);
  color: #075985;
}

.bo-pdf-layout-editor__element-lock {
  color: #7c3aed;
  font-weight: 700;
}

.bo-pdf-layout-editor__element-lock:hover {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}

.bo-pdf-layout-editor__element-remove:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.bo-pdf-layout-editor__grid {
  margin: 0;
  gap: 0.9rem 0.9rem;
}

.bo-pdf-layout-editor__grid .bo-form-row {
  margin-bottom: 0;
  min-width: 0;
}

.bo-pdf-layout-editor__grid .bo-form-row > label {
  margin-bottom: 0.42rem;
}

.bo-pdf-layout-editor__row--wide {
  min-width: 0;
}

.bo-pdf-layout-editor__grid--value-number {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
}

.bo-pdf-layout-editor__grid--value-number .bo-form-row:first-child input[type="number"] {
  max-width: 5.25rem;
}

.bo-pdf-layout-editor__grid--value-number .bo-form-row:nth-child(4) {
  grid-column: 1 / 2;
}

.bo-pdf-layout-editor__grid--value-number .bo-form-row:nth-child(5) {
  grid-column: 2 / 4;
}

.bo-pdf-layout-editor__grid--value-date,
.bo-pdf-layout-editor__grid--value-barcode {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bo-pdf-layout-kind-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.bo-pdf-layout-kind-picker__btn {
  min-height: 2.35rem;
  min-width: 2.35rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}

.bo-pdf-layout-kind-picker__btn.is-active {
  border-color: #60a5fa;
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.bo-pdf-layout-kind-picker__text {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
}

.bo-pdf-layout-kind-picker__icon {
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  position: relative;
}

.bo-pdf-layout-kind-picker__icon--line::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  border-top: 2px solid currentColor;
  transform: rotate(-16deg);
}

.bo-pdf-layout-kind-picker__icon--rect::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.bo-pdf-layout-kind-picker__icon--circle::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.bo-pdf-layout-kind-picker__icon--image::before {
  content: "";
  position: absolute;
  inset: 1px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.bo-pdf-layout-kind-picker__icon--image::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 6px;
  background:
    radial-gradient(circle at 80% 20%, currentColor 0 2px, transparent 2.5px),
    linear-gradient(135deg, transparent 0 40%, currentColor 40% 55%, transparent 55%),
    linear-gradient(45deg, transparent 0 35%, currentColor 35% 55%, transparent 55%);
}

.bo-pdf-layout-editor__check {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.bo-pdf-layout-editor__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.bo-pdf-layout-editor__icon-btn {
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
}

.bo-pdf-layout-editor__icon-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.bo-pdf-layout-editor__icon-btn--danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

.bo-pdf-layout-editor__icon-btn--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.bo-pdf-layout-editor__inline-field-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.bo-pdf-layout-editor__grid--grid-columns-top {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 4.75rem;
}

.bo-pdf-layout-editor__grid--grid-columns-select-row {
  grid-template-columns: minmax(0, 1.9fr) minmax(6rem, 0.55fr);
}

.bo-pdf-layout-editor__grid-column-field-row {
  grid-column: 1 / -1;
}

.bo-pdf-layout-editor__grid--grid-columns-top .bo-form-row:first-child {
  grid-column: 1 / 3;
  min-width: 0;
}

.bo-pdf-layout-editor__grid--grid-columns-top .bo-form-row:last-child {
  grid-column: 3;
  min-width: 4.75rem;
}

.bo-pdf-layout-editor__grid-column-field-row .bo-pdf-layout-editor__inline-field-action > .bo-smartinput,
.bo-pdf-layout-editor__grid--grid-columns-top #bo-pdf-layout-grid-column-select {
  width: 100%;
  max-width: none;
}

.bo-pdf-layout-editor__grid--grid-columns-top #bo-pdf-layout-grid-column-width {
  width: 100%;
  max-width: 4.75rem;
}

.bo-pdf-layout-editor__group .bo-pdf-layout-editor__grid {
  gap: 0.8rem 0.85rem;
}

.bo-pdf-layout-editor__group .bo-form-row > label {
  margin-bottom: 0.15rem;
}

.bo-pdf-layout-editor__multi-summary {
  min-height: 2.35rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 600;
}

.bo-pdf-layout-editor__toolbar-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.bo-pdf-layout-editor__toolbar-icon-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  font-size: 1rem;
}

.bo-pdf-layout-editor__toolbar-icon-btn--reset {
  color: #475569;
}

.bo-pdf-layout-editor__toolbar-icon-btn--clear {
  color: #dc2626;
}

.bo-pdf-layout-editor__toolbar-icon-btn--save {
  color: #0b66c3;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.bo-pdf-layout-editor__toolbar-icon-btn--save:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.bo-pdf-layout-editor__quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.bo-pdf-layout-editor__multi-hint {
  margin: 0;
  color: #64748b;
}

.bo-pdf-layout-context-menu {
  position: fixed;
  z-index: 12150;
  min-width: 12rem;
  padding: 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.bo-pdf-layout-context-menu__item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  text-align: left;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
}

.bo-pdf-layout-context-menu__item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.bo-modal__dialog--pdf-layout-rename {
  width: min(100%, 32rem);
  border-radius: 16px;
  overflow: hidden;
}

.bo-modal__dialog--pdf-layout-rename .bo-modal__head {
  padding: 0.95rem 1rem 0.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.bo-modal__dialog--pdf-layout-rename .bo-modal__title {
  font-size: 1.1rem;
}

.bo-pdf-layout-rename-modal__body {
  padding: 1rem;
}

.bo-pdf-layout-rename-modal__body .bo-form-row {
  margin-bottom: 0;
}

.bo-pdf-layout-rename-modal__body label {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: #334155;
}

.bo-pdf-layout-rename-modal__body .bo-smartinput {
  min-height: 2.7rem;
}

.bo-modal__dialog--pdf-layout-rename .bo-modal__foot {
  margin-top: 1rem;
  padding-top: 0.85rem;
}

.bo-pdf-layout-align-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.22rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  width: 100%;
  min-height: 2.35rem;
}

.bo-pdf-layout-align-toggle__btn {
  flex: 1 1 0;
  min-width: 0;
  height: 2rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.bo-pdf-layout-align-toggle__btn:hover {
  background: #f1f5f9;
}

.bo-pdf-layout-align-toggle__btn.is-active {
  background: #1f2937;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.bo-pdf-layout-align-toggle__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

.bo-pdf-layout-align-toggle__icon {
  width: 14px;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

.bo-pdf-layout-align-toggle__icon span {
  display: block;
  height: 1px;
  background: currentColor;
  border-radius: 999px;
}

.bo-pdf-layout-align-toggle__icon span:nth-child(1) { width: 14px; }
.bo-pdf-layout-align-toggle__icon span:nth-child(2) { width: 10px; }
.bo-pdf-layout-align-toggle__icon span:nth-child(3) { width: 12px; }

.bo-pdf-layout-align-toggle__icon--center {
  align-items: center;
}

.bo-pdf-layout-align-toggle__icon--right {
  align-items: flex-end;
}

.bo-pdf-layout-editor .bo-form-row .bo-color-field {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.bo-pdf-layout-editor .bo-form-row .bo-color-field__hex {
  width: 100%;
  min-width: 0;
}

.bo-pdf-layout-editor .bo-form-row .bo-color-field__picker-btn {
  flex: 0 0 auto;
}

.bo-pdf-layout-editor .bo-form-grid--2.bo-pdf-layout-editor__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bo-pdf-layout-editor .bo-form-grid--2.bo-pdf-layout-editor__grid--value-number {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
}

.bo-pdf-layout-editor__grid--position {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.bo-pdf-layout-editor__grid--visual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bo-pdf-layout-editor__grid--visual .bo-form-row:first-child {
  grid-column: 1 / -1;
}

@media (max-width: 1400px) {
  .bo-pdf-layout-editor .bo-form-grid--2.bo-pdf-layout-editor__grid {
    grid-template-columns: 1fr;
  }

  .bo-pdf-layout-editor .bo-form-grid--2.bo-pdf-layout-editor__grid--value-number,
  .bo-pdf-layout-editor .bo-form-grid--2.bo-pdf-layout-editor__grid--value-date,
  .bo-pdf-layout-editor .bo-form-grid--2.bo-pdf-layout-editor__grid--value-barcode {
    grid-template-columns: 1fr;
  }

  .bo-pdf-layout-editor .bo-form-grid--2.bo-pdf-layout-editor__grid--position {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .bo-pdf-layout-editor .bo-form-grid--2.bo-pdf-layout-editor__grid .bo-form-span-2 {
    grid-column: auto;
  }

  .bo-pdf-layout-editor__grid--value-number .bo-form-row:nth-child(4),
  .bo-pdf-layout-editor__grid--value-number .bo-form-row:nth-child(5) {
    grid-column: auto;
  }
}

@media (min-width: 1401px) {
  .bo-pdf-layout-editor__grid--visual .bo-form-span-2 {
    grid-column: 1 / -1;
  }
}

.bo-pdf-layout-editor__status.is-error {
  color: #b91c1c;
}

.bo-pdf-layouts__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
}

.bo-pdf-layouts__badge.is-custom {
  background: #dbeafe;
  color: #1d4ed8;
}

.bo-pdf-layouts__smarttemplate {
  margin-bottom: 0.9rem;
}

.bo-pdf-layouts__table-wrap {
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #fff;
  overflow: auto;
  height: calc(100vh - 355px);
  max-height: calc(100vh - 355px);
  min-height: 360px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.bo-pdf-layouts__table-wrap .bo-pdf-layouts__table {
  min-width: 860px;
  table-layout: fixed;
}

.bo-pdf-layouts__table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
}

.bo-pdf-layouts__table th:nth-child(1),
.bo-pdf-layouts__table td:nth-child(1) {
  width: 21%;
}

.bo-pdf-layouts__table th:nth-child(2),
.bo-pdf-layouts__table td:nth-child(2) {
  width: 38%;
}

.bo-pdf-layouts__table th:nth-child(3),
.bo-pdf-layouts__table td:nth-child(3) {
  width: 9%;
}

.bo-pdf-layouts__table th:nth-child(4),
.bo-pdf-layouts__table td:nth-child(4) {
  width: 11%;
}

.bo-pdf-layouts__table th:nth-child(5),
.bo-pdf-layouts__table td:nth-child(5) {
  width: 8%;
}

.bo-pdf-layouts__table th:nth-child(6),
.bo-pdf-layouts__table td:nth-child(6) {
  width: 13%;
}

.bo-pdf-layouts__table td:nth-child(3),
.bo-pdf-layouts__table td:nth-child(4),
.bo-pdf-layouts__table td:nth-child(5),
.bo-pdf-layouts__table th:nth-child(3),
.bo-pdf-layouts__table th:nth-child(4),
.bo-pdf-layouts__table th:nth-child(5) {
  text-align: center;
}

.bo-pdf-layouts__switch,
.bo-pdf-layouts__radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bo-pdf-layouts__switch input,
.bo-pdf-layouts__radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bo-pdf-layouts__switch-ui {
  width: 2.2rem;
  height: 1.3rem;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.bo-pdf-layouts__switch-ui::after {
  content: '';
  position: absolute;
  top: 0.14rem;
  left: 0.14rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.bo-pdf-layouts__switch input:checked + .bo-pdf-layouts__switch-ui {
  background: #22c55e;
}

.bo-pdf-layouts__switch input:checked + .bo-pdf-layouts__switch-ui::after {
  transform: translateX(0.9rem);
}

.bo-pdf-layouts__radio span {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  display: inline-block;
  position: relative;
  background: #fff;
}

.bo-pdf-layouts__radio input:checked + span {
  border-color: #2563eb;
}

.bo-pdf-layouts__radio input:checked + span::after {
  content: '';
  position: absolute;
  inset: 0.16rem;
  border-radius: 50%;
  background: #2563eb;
}

.bo-pdf-layouts__table .bo-icon-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 0.6rem;
  background: #fff;
  color: #475569;
}

.bo-pdf-layouts__table .bo-icon-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}

.bo-pdf-layouts__table .bo-td-actions {
  text-align: right;
  vertical-align: middle;
  width: 6.5rem;
  white-space: nowrap;
}

.bo-pdf-layouts__table .bo-partner-users-edit-btn {
  color: #64748b;
}

.bo-pdf-layouts__table .bo-partner-users-edit-btn:hover {
  color: var(--zswms-accent);
}

.bo-pdf-layouts__table td:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bo-pdf-layouts__desc-input {
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.85rem;
  min-height: 2.65rem;
  font: inherit;
  font-size: 0.95rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--zswms-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bo-pdf-layouts__desc-input::placeholder {
  color: #94a3b8;
}

.bo-pdf-layouts__desc-input:focus {
  outline: none;
  border-color: var(--zswms-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.bo-pdf-layout-editor__meta {
  min-width: 0;
}

.bo-pdf-layout-editor__meta-hint {
  display: block;
  margin-top: 0;
  color: #64748b;
  font-size: 0.82rem;
  max-width: 420px;
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .bo-pdf-layout-editor__body {
    grid-template-columns: 1fr;
  }

  .bo-pdf-layout-editor__sidebar {
    position: static;
    max-height: none;
  }

  .bo-pdf-layout-canvas-viewport {
    max-height: 50vh;
    min-height: 46vh;
  }
}
