/* SMARTDIGIT Backoffice — tema premium (sidebar escuro) */
*, *::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__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__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;
  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;
}

.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-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;
}

/* 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__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;
}

.bo-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 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__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(150px, 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(300px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

.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%;
}

.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;
}

.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-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: rótulos na 1.ª linha, campo e toggle na 2.ª (largura ~ metade do formulário) */
.bo-form-row--nif-active {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0.35rem 1.25rem;
  align-items: start;
}

.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[for="tax_id"] {
    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;
}

.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);
}

/* 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;
}

.bo-pu-modal-grid-main > .bo-pu-modal-toggle-cell {
  align-self: center;
}

.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;
  }
}

.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): 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-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__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;
}
