:root {
  --bg: #090909;
  --bg-deep: #050505;
  --surface: #101112;
  --surface-2: #151617;
  --surface-3: #1b1c1e;
  --line: #2a2b2e;
  --line-strong: #3b3d42;
  --text: #f4f4f5;
  --text-soft: #d5d6d8;
  --muted: #92959b;
  --muted-2: #666a70;
  --accent: #1877F2;
  --accent-hover: #166fe5;
  --accent-soft: rgba(24, 119, 242, .12);
  --accent-line: rgba(24, 119, 242, .42);
  --danger: #ed6464;
  --danger-bg: #1b1010;
  --danger-line: #713737;
  --success: #a9c9b5;
  --success-bg: #101813;
  --success-line: #304a38;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); }
a { color: #b8c7df; text-decoration: none; }
a:hover { color: #fff; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
h1, h2, p { margin-top: 0; }

/* ---------- Autenticação ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.03fr) minmax(440px, .97fr);
  background: var(--bg);
}

.brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  border-right: 1px solid #242527;
  background: #070809;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--accent);
}

.brand-panel::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -150px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(24, 119, 242, .2);
  border-radius: 50%;
  pointer-events: none;
}

.brand-wrap {
  position: relative;
  z-index: 1;
  width: min(610px, 78%);
  margin: auto;
  padding: 54px 0 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -.025em;
}
.brand:hover { color: var(--text); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.brand-copy { margin-top: 66px; }

.eyebrow,
.form-kicker {
  display: block;
  margin-bottom: 11px;
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 760;
}

.brand-copy h1 {
  max-width: 540px;
  margin-bottom: 17px;
  font-size: clamp(38px, 4.3vw, 63px);
  line-height: 1.01;
  letter-spacing: -.055em;
  font-weight: 690;
}

.brand-copy p {
  max-width: 470px;
  margin-bottom: 0;
  color: #9b9da2;
  font-size: 16px;
  line-height: 1.65;
}

/* Ilustração abstrata própria do HavenSoft, sem assets externos. */
.visual-scene {
  position: relative;
  width: min(520px, 100%);
  height: 245px;
  margin-top: 42px;
  overflow: hidden;
  border: 1px solid #222428;
  border-radius: 18px;
  background: #0d0e10;
}

.visual-scene::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 92px;
  height: 5px;
  background: var(--accent);
}

.visual-orbit {
  position: absolute;
  border: 1px solid rgba(24, 119, 242, .28);
  border-radius: 50%;
}
.orbit-large { width: 265px; height: 265px; left: 36px; top: -6px; }
.orbit-small { width: 150px; height: 150px; left: 94px; top: 52px; border-color: rgba(24, 119, 242, .18); }

.visual-core,
.visual-node {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid #2c2f34;
  background: #121419;
  color: #f5f7fb;
  font-weight: 800;
}

.visual-core {
  left: 143px;
  top: 94px;
  width: 63px;
  height: 63px;
  border-color: var(--accent-line);
  border-radius: 16px;
  background: var(--accent);
}
.core-mark { font-size: 24px; }

.visual-node {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 10px;
}
.node-a { left: 53px; top: 56px; color: var(--accent); }
.node-b { left: 74px; bottom: 32px; color: #cfd1d5; }
.node-c { left: 236px; top: 45px; color: var(--accent); }

.visual-window {
  position: absolute;
  right: 30px;
  top: 45px;
  width: 205px;
  padding: 13px;
  border: 1px solid #34363b;
  border-radius: 12px;
  background: #16181b;
}
.window-top { display: flex; gap: 5px; padding-bottom: 11px; border-bottom: 1px solid #292b2f; }
.window-top span { width: 6px; height: 6px; border-radius: 50%; background: #55585e; }
.window-top span:first-child { background: var(--accent); }
.window-body { display: flex; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid #25272b; }
.window-body:last-child { border-bottom: 0; padding-bottom: 2px; }
.window-avatar { width: 27px; height: 27px; border-radius: 7px; background: #252a31; border: 1px solid #343943; }
.window-avatar.alt { background: var(--accent-soft); border-color: var(--accent-line); }
.window-copy { flex: 1; display: grid; gap: 6px; }
.window-copy b, .window-copy i { display: block; height: 5px; border-radius: 999px; background: #44474d; }
.window-copy b { width: 76%; }
.window-copy i { width: 48%; background: #2b2d31; }

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 20px;
  margin-top: 24px;
  color: #7d8086;
  font-size: 12px;
}
.trust-list div { display: flex; align-items: center; gap: 8px; }
.trust-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.form-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px clamp(28px, 5vw, 84px);
  background: #0d0e0f;
}

.form-shell { width: min(430px, 100%); }
.mobile-brand { display: none; margin-bottom: 42px; }

.form-card {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.surface-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 27px;
  padding: 6px 9px;
  border: 1px solid #2e3034;
  border-radius: 6px;
  color: #a7a9ae;
  background: #121315;
  font-size: 11px;
  font-weight: 650;
}
.surface-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.view header { margin-bottom: 30px; }
.view h2 {
  margin-bottom: 9px;
  font-size: clamp(29px, 3vw, 37px);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 710;
}
.view header p,
.content-card > p,
.hero-card p {
  color: var(--muted);
  line-height: 1.58;
}
.view header p { margin-bottom: 0; font-size: 14px; }

form { display: grid; gap: 18px; }
label {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

input {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  border: 1px solid #323439;
  outline: none;
  border-radius: 8px;
  background: #111214;
  color: var(--text);
  caret-color: var(--accent);
  transition: border-color .14s, background-color .14s;
}
input::placeholder { color: #5d6066; }
input:hover { border-color: #474a50; }
input:focus {
  border-color: var(--accent);
  background: #121418;
  box-shadow: none;
}

input.is-invalid,
label.field-invalid input,
.password-field.field-invalid input {
  border-color: var(--danger) !important;
  background: #161010;
}
input.is-invalid:focus,
label.field-invalid input:focus,
.password-field.field-invalid input:focus {
  border-color: #f07b7b !important;
  box-shadow: none;
}
.field-error {
  display: block;
  margin-top: -2px;
  color: #ef7777;
  font-size: 11px;
  font-weight: 590;
  line-height: 1.35;
}

.otp-input {
  letter-spacing: .28em;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 720;
}

.password-field { position: relative; display: block; }
.password-field input { padding-right: 80px; }
.ghost-icon {
  position: absolute;
  right: 7px;
  top: 8px;
  height: 33px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #7f8288;
  font-size: 11px;
  font-weight: 650;
}
.ghost-icon:hover { color: #d8d9dc; background: #1a1b1e; }

.form-row { display: flex; align-items: center; gap: 14px; }
.between { justify-content: space-between; }
.form-options { margin-top: -2px; }
.form-options a { color: #8fb8ee; font-size: 11px; font-weight: 620; }
.form-options a:hover { color: #fff; }
.check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: #8e9197;
  font-weight: 520;
}
.check input { width: 15px; height: 15px; accent-color: var(--accent); }

.primary,
.secondary {
  min-height: 46px;
  padding: 0 17px;
  border-radius: 8px;
  font-weight: 720;
  transition: background-color .14s, border-color .14s, color .14s;
}
.primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); filter: none; }
.primary:active { background: #1264d0; }
.primary:disabled { opacity: .5; cursor: wait; }
.secondary {
  border: 1px solid #383a3f;
  background: #151619;
  color: #d7d8db;
}
.secondary:hover { background: #1c1e22; border-color: #50535a; color: #fff; }
.link-button { display: inline-flex; align-items: center; justify-content: center; }
.text-button,
.back-link {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #a6b9d7;
}
.text-button:hover, .back-link:hover { color: #fff; }
.text-button { margin-top: 14px; }
.back-link { margin-bottom: 17px; }
.footer-link { display: inline-block; margin-top: 24px; color: #9db7dc; font-size: 12px; }

.form-footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  color: #65686e;
  font-size: 10px;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.auth-footer { margin-top: 26px; color: #56595f; font-size: 10px; }

.flash {
  margin-bottom: 20px;
  padding: 11px 13px;
  border: 1px solid var(--danger-line);
  border-radius: 8px;
  background: var(--danger-bg);
  color: #ef9a9a;
  font-size: 12px;
  line-height: 1.45;
}
.flash.success { border-color: var(--success-line); background: var(--success-bg); color: #a8c7b3; }

body[data-view="view-setup"] .form-shell { width: min(690px, 100%); }

.totp-setup-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 21px;
}

.qr-panel {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 15px;
  border: 1px solid #2c2e32;
  border-radius: 8px;
  background: #111214;
}

.totp-qr {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 3px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid #d8d8d8;
  border-radius: 7px;
  background: #fff;
  color: #3b3b3b;
  text-align: center;
  font-size: 11px;
}
.totp-qr svg { display: block; width: 100%; height: 100%; }
.totp-qr.qr-error {
  aspect-ratio: auto;
  min-height: 150px;
  padding: 18px;
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: #ef9a9a;
}
.qr-panel > strong { font-size: 13px; }
.qr-panel > p { margin: 0; color: #9a9da3; font-size: 11px; line-height: 1.5; }
.qr-panel > small { color: #686b71; font-size: 9px; line-height: 1.45; }

.setup-steps {
  display: grid;
  gap: 7px;
  margin: 2px 0 0;
  padding-left: 19px;
  color: #85888e;
  font-size: 10px;
  line-height: 1.5;
}

.setup-box {
  display: grid;
  gap: 12px;
  margin-bottom: 21px;
  padding: 16px;
  border: 1px solid #2c2e32;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #111214;
}
.setup-box span { color: var(--muted); font-size: 11px; }
.setup-box code { overflow-wrap: anywhere; color: #e2e3e5; font-size: 15px; letter-spacing: .07em; }
.button-row { display: flex; gap: 9px; flex-wrap: wrap; }
.recovery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.recovery-grid code { padding: 10px; border: 1px solid #303237; border-radius: 7px; background: #111214; text-align: center; }
.password-hint { color: var(--muted); font-size: 11px; line-height: 1.45; }

/* ---------- Aplicação ---------- */
.app-body { min-height: 100vh; background: #090909; }
.app-layout { min-height: 100vh; display: grid; grid-template-columns: 224px 1fr; }

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 24px 14px;
  border-right: 1px solid #242529;
  background: #0c0d0e;
}
.brand.compact { padding: 0 10px; font-size: 18px; }
.brand.compact .brand-mark { width: 32px; height: 32px; border-radius: 7px; }
.sidebar nav { display: grid; gap: 4px; margin-top: 42px; }

.nav-item {
  position: relative;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #85888e;
  text-align: left;
  font-size: 13px;
  font-weight: 590;
}
.nav-item:hover { background: #141517; color: #d8d9dc; }
.nav-item.active { border-color: #2c2e32; background: #15171a; color: #f4f4f5; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.logout { margin-top: auto; color: #777a80; }
.logout:hover { color: #ddd; }

.app-main { padding: 30px clamp(24px, 4.4vw, 64px); background: #090909; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.topbar h1 { margin: 0; font-size: 28px; letter-spacing: -.035em; font-weight: 660; }
.topbar .eyebrow { margin-bottom: 8px; }

.user-chip {
  display: grid;
  gap: 2px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1012;
  text-align: right;
  font-size: 12px;
}
.user-chip small { color: var(--muted); }

.app-section { max-width: 1040px; }
.hero-card,
.content-card,
.stat-card {
  border: 1px solid #25272b;
  border-radius: 10px;
  background: #101113;
  box-shadow: none;
}
.hero-card { position: relative; overflow: hidden; padding: 28px; }
.hero-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}
.hero-card h2 { max-width: 700px; margin-bottom: 9px; font-size: 29px; letter-spacing: -.035em; font-weight: 640; }
.hero-card p { max-width: 720px; margin-bottom: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.stat-card { display: grid; gap: 7px; padding: 18px; }
.stat-card span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { font-size: 18px; font-weight: 650; }
.stat-card:nth-child(2) strong { color: #b8cef0; }

.content-card { padding: 26px; }
.stack-form { max-width: 520px; margin-top: 24px; }
.fit { justify-self: start; }
.separator { height: 1px; margin: 30px 0; background: var(--line); }
.security-action,
.section-heading,
.session-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.security-action p,
.section-heading p { margin: 4px 0 0; color: var(--muted); }
.sessions-list { display: grid; gap: 0; margin-top: 20px; border-top: 1px solid var(--line); }
.session-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.session-meta { display: grid; gap: 4px; }
.session-meta small { color: var(--muted); }
.session-current { color: #9db7dc; font-size: 11px; }
.session-row button { min-height: 34px; }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: minmax(330px, .9fr) minmax(410px, 1.1fr); }
  .brand-wrap { width: min(520px, 82%); }
  .visual-window { right: 18px; width: 185px; }
  .visual-core { left: 112px; }
  .orbit-large { left: 8px; }
  .orbit-small { left: 65px; }
  .node-a { left: 25px; }
  .node-b { left: 45px; }
  .node-c { left: 205px; }
}

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .form-panel { min-height: 100vh; padding: 40px 24px; }
  .form-shell { width: min(440px, 100%); }
  .mobile-brand { display: inline-flex; }

  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar nav { display: flex; margin: 0 0 0 auto; }
  .nav-item { width: auto; }
  .nav-item.active::before { left: 8px; right: 8px; top: auto; bottom: -1px; width: auto; height: 2px; }
  .logout { margin: 0; }
  .brand.compact span:last-child { display: none; }
  .app-main { padding: 24px 18px; }
  .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body[data-view="view-setup"] .form-shell { width: min(440px, 100%); }
  .totp-setup-grid { grid-template-columns: 1fr; }
  .qr-panel { justify-items: start; }
  .totp-qr { width: min(220px, 100%); }
}

@media (max-width: 560px) {
  .form-panel { padding: 30px 19px; }
  .mobile-brand { margin-bottom: 36px; }
  .view h2 { font-size: 30px; }
  .surface-badge { margin-bottom: 23px; }
  .recovery-grid { grid-template-columns: 1fr; }
  .form-row.between { align-items: flex-start; }
  .form-options { gap: 10px; }
  .topbar { align-items: flex-start; }
  .user-chip { display: none; }
  .sidebar nav .nav-item { padding: 9px; font-size: 11px; }
  .security-action, .section-heading, .session-row { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* ---------- FASE 08-G: wordmark + cabeçalho de aplicação ---------- */
.brand-wordmark {
  gap: 0;
  font-family: "Google Sans", "Google Sans Text", "Product Sans", "Segoe UI", Arial, sans-serif;
  font-weight: 300;
  letter-spacing: -.035em;
}
.brand.compact.brand-wordmark {
  padding: 0 10px;
  font-size: 21px;
  font-weight: 300;
}

.app-main {
  min-width: 0;
  padding-top: 22px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, .7fr) minmax(280px, 620px) auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid #202226;
}
.topbar-heading { min-width: 0; }
.topbar-heading .eyebrow { margin-bottom: 6px; }
.topbar h1 { font-size: 24px; font-weight: 610; }

.topbar-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 42px;
  padding: 0 11px 0 13px;
  border: 1px solid #292b30;
  border-radius: 9px;
  background: #101113;
  transition: border-color .16s ease, background .16s ease;
}
.topbar-search:focus-within {
  border-color: var(--accent);
  background: #111318;
}
.topbar-search svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #777b83;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.topbar-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
}
.topbar-search input::placeholder { color: #686c73; }
.topbar-search input:focus-visible { outline: 0; }
.topbar-search kbd {
  padding: 3px 6px;
  border: 1px solid #303238;
  border-radius: 5px;
  background: #151619;
  color: #737780;
  font-family: inherit;
  font-size: 10px;
  font-weight: 540;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.menu-anchor { position: relative; }
.profile-anchor { min-width: 0; }

.icon-action {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #292b30;
  border-radius: 9px;
  background: #101113;
  color: #a2a5aa;
}
.icon-action:hover,
.icon-action[aria-expanded="true"] {
  border-color: #3a3d43;
  background: #151619;
  color: #f1f2f3;
}
.icon-action svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notification-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border: 2px solid #101113;
  border-radius: 50%;
  background: var(--accent);
}

.profile-trigger {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 9px;
  min-width: 190px;
  max-width: 250px;
  height: 48px;
  padding: 3px 9px 3px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] {
  border-color: #292b30;
  background: #101113;
}
.profile-trigger-copy {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}
.profile-trigger-copy strong {
  overflow: hidden;
  color: #e3e4e6;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-trigger-copy small {
  overflow: hidden;
  margin-top: 3px;
  color: #737780;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid #34363b;
  border-radius: 50%;
  background: #1a1b1e;
  color: #cbd5e5;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
}
.user-avatar.large { width: 53px; height: 53px; font-size: 0.8rem; }
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-chevron {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid #757981;
  border-bottom: 1.5px solid #757981;
  transform: rotate(45deg);
  transition: transform .16s ease;
}
.profile-trigger[aria-expanded="true"] .profile-chevron {
  margin-top: 3px;
  transform: rotate(225deg);
}

.floating-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 60;
  width: 285px;
  overflow: hidden;
  border: 1px solid #2b2d32;
  border-radius: 11px;
  background: #101113;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .34);
}
.floating-menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 15px;
  border-bottom: 1px solid #24262a;
}
.floating-menu-heading strong { font-size: 12px; font-weight: 610; }
.floating-menu-heading span { color: var(--muted); font-size: 10px; }
.notification-menu { width: 310px; }
.empty-notifications {
  display: grid;
  justify-items: center;
  padding: 28px 18px 30px;
  text-align: center;
}
.empty-notifications-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 11px;
  border: 1px solid #303238;
  border-radius: 50%;
  color: #8f939a;
  font-size: 12px;
}
.empty-notifications strong { font-size: 12px; font-weight: 600; }
.empty-notifications p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }

.profile-menu { width: 278px; padding: 8px; }
.profile-menu-user {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
}
.profile-menu-user div { display: grid; min-width: 0; gap: 3px; }
.profile-menu-user strong,
.profile-menu-user small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-menu-user strong { color: #e7e8ea; font-size: 12px; font-weight: 610; }
.profile-menu-user small { color: var(--muted); font-size: 10px; }
.profile-menu button[role="menuitem"] {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #b9bcc2;
  text-align: left;
  font-size: 12px;
}
.profile-menu button[role="menuitem"]:hover { background: #191a1d; color: #f1f2f3; }
.profile-menu .danger-menu-item { color: #d88b8b; }
.profile-menu .danger-menu-item:hover { background: #1b1213; color: #efabab; }
.menu-separator { height: 1px; margin: 6px 4px; background: #25272b; }

@media (max-width: 1120px) {
  .topbar { grid-template-columns: minmax(170px, .55fr) minmax(240px, 1fr) auto; gap: 14px; }
  .profile-trigger { min-width: 42px; width: 42px; padding: 3px; grid-template-columns: 40px; }
  .profile-trigger-copy, .profile-chevron { display: none; }
}

@media (max-width: 820px) {
  .brand.compact.brand-wordmark { display: inline-flex; font-size: 18px; }
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }
  .topbar-search { grid-column: 1 / -1; grid-row: 2; }
  .topbar-actions { grid-column: 2; grid-row: 1; }
  .topbar-heading { grid-column: 1; grid-row: 1; }
}

@media (max-width: 560px) {
  .topbar { align-items: center; }
  .topbar-search kbd { display: none; }
  .topbar h1 { font-size: 21px; }
  .notification-menu { position: fixed; top: 76px; right: 14px; width: min(310px, calc(100vw - 28px)); }
  .profile-menu { position: fixed; top: 76px; right: 14px; width: min(278px, calc(100vw - 28px)); }
}

/* ---------- FASE 09 · gestão comercial ---------- */
.platform-navigation { display: grid; gap: 4px; }
.nav-group-label { display: block; margin: 22px 12px 7px; color: #5f636a; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.section-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-toolbar h2, .card-heading h3, .subsection-heading h4 { margin: 0 0 5px; }
.section-toolbar p, .card-heading p { margin: 0; color: var(--muted); }
.admin-form { margin-bottom: 14px; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid label { display: grid; gap: 7px; color: #aaaeb5; font-size: 11px; font-weight: 600; }
.form-grid .span-two { grid-column: 1 / -1; }
.form-grid .span-three { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .table-filter input, .table-filter select {
  width: 100%; min-height: 40px; border: 1px solid #303238; border-radius: 7px; background: #0c0d0f; color: #f1f2f3; padding: 0 11px; outline: 0;
}
.form-grid input:focus, .form-grid select:focus, .table-filter input:focus, .table-filter select:focus { border-color: #1877F2; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.table-card { padding: 0; overflow: hidden; }
.table-filter { display: grid; grid-template-columns: minmax(200px, 1fr) 190px; gap: 10px; padding: 15px; border-bottom: 1px solid #25272b; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { padding: 11px 15px; color: #71757c; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: left; border-bottom: 1px solid #25272b; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid #202226; color: #c9cbd0; font-size: 12px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td strong { display: block; color: #f2f3f4; font-size: 12px; font-weight: 630; }
.data-table td small { display: block; margin-top: 3px; color: #696d74; }
.empty-cell { padding: 32px !important; text-align: center; color: #70747a !important; }
.table-actions { text-align: right; white-space: nowrap; }
.table-button { border: 1px solid #34363b; border-radius: 6px; background: #111214; color: #aeb1b7; padding: 6px 9px; font-size: 10px; }
.table-button:hover { border-color: #4a4d54; color: #fff; }
.status-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border: 1px solid #33363b; border-radius: 999px; background: #151619; color: #a7abb1; font-size: 9px; font-weight: 700; }
.status-active, .status-published { border-color: rgba(24,119,242,.35); color: #8fbbf5; background: rgba(24,119,242,.08); }
.status-suspended, .status-past_due { color: #d9bb83; border-color: #55452d; background: #18140f; }
.status-cancelled, .status-retired { color: #9b9da2; background: #121315; }
.status-trial, .status-draft, .status-provisioning { color: #abb4c0; }
.catalog-grid { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 12px; }
.card-heading, .subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-heading { margin-bottom: 20px; }
.entity-list, .compact-list, .version-list { display: grid; gap: 6px; }
.entity-row { width: 100%; display: flex; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid #282a2e; border-radius: 7px; background: #0d0e10; color: #bbbfc5; text-align: left; }
.entity-row:hover, .entity-row.active { border-color: #3b3e44; background: #131416; }
.entity-row.active { box-shadow: inset 2px 0 0 #1877F2; }
.entity-row strong, .compact-row strong, .version-row strong { display: block; color: #eff0f2; font-size: 11px; }
.entity-row small, .compact-row small, .version-row small { display: block; margin-top: 3px; color: #6f737a; font-size: 9px; }
.compact-row, .version-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 43px; padding: 8px 9px; border-bottom: 1px solid #222429; }
.compact-row:last-child, .version-row:last-child { border-bottom: 0; }
.catalog-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.inline-editor { margin-top: 24px; padding-top: 20px; border-top: 1px solid #292b30; }
.empty-state { display: grid; place-items: center; align-content: center; min-height: 220px; text-align: center; color: #6e7279; }
.empty-state strong { color: #bfc2c7; }
.empty-state p, .muted-copy { color: #6e7279; font-size: 11px; }
.small { padding: 6px 9px; min-height: 30px; font-size: 10px; }
.module-checks { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 12px; border: 1px solid #2d3035; border-radius: 7px; }
.module-checks legend { padding: 0 5px; color: #7e8289; font-size: 10px; }
.check-option { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 6px !important; padding: 6px 8px; border: 1px solid #2c2f34; border-radius: 6px; background: #101113; }
.check-option input { width: auto; min-height: auto; }
.version-list { margin: 12px 0 20px; border: 1px solid #26282d; border-radius: 7px; padding: 0 10px; }

@media (max-width: 900px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-columns { grid-template-columns: 1fr; }
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .span-two, .form-grid .span-three { grid-column: auto; }
  .table-filter { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .section-toolbar { align-items: stretch; flex-direction: column; }
}

/* ---------- FASE 09-B · navegação primária + subnavegação contextual ---------- */
.app-layout {
  --sidebar-width: 224px;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
}
.app-layout.sidebar-collapsed { --sidebar-width: 72px; }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  min-width: 0;
  overflow: visible;
  padding: 22px 14px 16px;
  transition: padding .18s ease;
}
.sidebar-brand-row {
  display: flex;
  min-height: 34px;
  align-items: center;
}
.sidebar-brand {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.brand-short { display: none; }

.primary-nav {
  display: grid;
  gap: 5px;
  margin-top: 38px;
}
.primary-nav-item,
.sidebar-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #858990;
  text-align: left;
  font: inherit;
  font-size: 12px;
  font-weight: 560;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.primary-nav-item svg,
.sidebar-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.primary-nav-item[data-nav-group="management"] svg { fill: currentColor; stroke: none; }
.primary-nav-item:hover,
.sidebar-toggle:hover {
  background: #141517;
  color: #d8dadd;
}
.primary-nav-item.active {
  border-color: #282b30;
  background: #15171a;
  color: #f2f3f4;
}
.primary-nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #1877F2;
}
.sidebar-toggle {
  margin-top: auto;
  color: #6f737a;
}
.sidebar-toggle svg { transition: transform .18s ease; }

.sidebar.is-collapsed {
  padding-left: 13px;
  padding-right: 13px;
}
.sidebar.is-collapsed .sidebar-brand {
  display: grid;
  place-items: center;
  padding: 0;
}
.sidebar.is-collapsed .brand-full { display: none; }
.sidebar.is-collapsed .brand-short {
  display: inline;
  color: #f3f4f5;
  font-family: "Google Sans", "Google Sans Text", "Product Sans", "Segoe UI", Arial, sans-serif;
  font-size: 21px;
  font-weight: 300;
  letter-spacing: -.05em;
}
.sidebar.is-collapsed .primary-nav-item,
.sidebar.is-collapsed .sidebar-toggle {
  grid-template-columns: 1fr;
  justify-items: center;
  width: 44px;
  min-width: 44px;
  padding: 0;
  margin-left: auto;
  margin-right: auto;
}
.sidebar.is-collapsed .nav-label { display: none; }
.sidebar.is-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar.is-collapsed [data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 80;
  left: calc(100% + 11px);
  top: 50%;
  transform: translate(4px, -50%);
  width: max-content;
  max-width: 180px;
  padding: 7px 9px;
  border: 1px solid #303238;
  border-radius: 7px;
  background: #151619;
  color: #e7e8ea;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .26);
  font-size: 11px;
  font-weight: 540;
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.sidebar.is-collapsed [data-tooltip]:hover::after,
.sidebar.is-collapsed [data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

.topbar { margin-bottom: 16px; }
.section-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: start;
  gap: 3px;
  max-width: 100%;
  margin: 0 0 28px;
  padding: 0 1px;
  overflow-x: auto;
  border-bottom: 1px solid #23252a;
  scrollbar-width: thin;
}
.section-tabs[hidden] { display: none; }
.section-tab {
  position: relative;
  min-height: 43px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: #747880;
  font: inherit;
  font-size: 11px;
  font-weight: 580;
  white-space: nowrap;
  cursor: pointer;
  transition: color .14s ease, background .14s ease;
}
.section-tab:hover { color: #c6c9ce; background: #101113; }
.section-tab.active { color: #f1f2f3; }
.section-tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #1877F2;
}

@media (max-width: 820px) {
  .app-layout,
  .app-layout.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar,
  .sidebar.is-collapsed {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid #242529;
  }
  .sidebar-brand-row { min-height: 34px; }
  .sidebar-brand,
  .sidebar.is-collapsed .sidebar-brand {
    display: inline-flex;
    width: auto;
    padding: 0;
  }
  .sidebar .brand-full,
  .sidebar.is-collapsed .brand-full { display: inline; }
  .sidebar .brand-short,
  .sidebar.is-collapsed .brand-short { display: none; }
  .primary-nav,
  .sidebar.is-collapsed .primary-nav {
    display: flex;
    gap: 4px;
    margin: 0 0 0 auto;
  }
  .primary-nav-item,
  .sidebar.is-collapsed .primary-nav-item {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0;
  }
  .primary-nav-item .nav-label { display: none; }
  .primary-nav-item.active::before {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: -1px;
    width: auto;
    height: 2px;
  }
  .sidebar-toggle { display: none; }
  .sidebar.is-collapsed [data-tooltip]::after { display: none; }
  .section-tabs { margin-bottom: 22px; }
}

@media (max-width: 560px) {
  .section-tab { padding: 0 10px; }
  .section-tab.active::after { left: 9px; right: 9px; }
}

/* ---------- FASE 09-C · confirmação padrão + detalhes de organização ---------- */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 3, 5, .72);
  backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }
.system-modal {
  width: min(540px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid #2b2e33;
  border-radius: 12px;
  background: #111214;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .48);
  color: #e9eaec;
}
.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
}
.modal-header { border-bottom: 1px solid #24262a; }
.modal-header h2 { margin: 4px 0 0; font-size: 18px; font-weight: 620; letter-spacing: -.02em; }
.modal-subtitle { margin: 5px 0 0; color: #777b82; font-size: 11px; }
.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #7e8289;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { border-color: #303238; background: #17181b; color: #f0f1f2; }
.modal-body { display: grid; gap: 16px; padding: 20px; }
.modal-message { margin: 0; color: #c6c9ce; font-size: 13px; line-height: 1.55; }
.modal-impact {
  padding: 12px 13px;
  border: 1px solid #3a352b;
  border-radius: 8px;
  background: #17140f;
  color: #cdb987;
  font-size: 11px;
  line-height: 1.5;
}
.action-modal.is-danger .modal-impact { border-color: #4a2c2e; background: #191112; color: #dfa1a4; }
.modal-field { display: grid; gap: 7px; color: #aeb1b7; font-size: 11px; font-weight: 600; }
.modal-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  padding: 10px 11px;
  border: 1px solid #303238;
  border-radius: 8px;
  outline: none;
  background: #0b0c0e;
  color: #f1f2f3;
  font: inherit;
  line-height: 1.45;
}
.modal-field textarea:focus { border-color: #1877F2; }
.modal-field textarea.is-invalid { border-color: #9c3f46; }
.field-help { color: #666a71; font-size: 10px; font-weight: 450; }
.modal-footer { justify-content: flex-end; border-top: 1px solid #24262a; background: #0f1012; }
.action-modal.is-danger #action-modal-confirm { background: #a43e46; border-color: #a43e46; color: #fff; }
.action-modal.is-danger #action-modal-confirm:hover { background: #b34750; }
.danger-outline {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #553136;
  border-radius: 7px;
  background: transparent;
  color: #d48c92;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.danger-outline:hover { border-color: #704048; background: #1a1113; color: #efadb2; }

.tenant-detail-modal { width: min(1120px, 100%); }
.tenant-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tenant-modal-header { align-items: flex-start; }
.modal-loading { padding: 46px 20px; color: #7c8087; text-align: center; }
.tenant-detail-content { max-height: calc(100vh - 220px); overflow: auto; }
.tenant-detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .8fr); gap: 0; }
.tenant-edit-form { min-width: 0; padding: 20px; border-right: 1px solid #24262a; }
.tenant-detail-side { min-width: 0; padding: 20px; background: #0f1012; }
.detail-section { padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid #24262a; }
.detail-section:last-child { margin-bottom: 0; border-bottom: 0; }
.detail-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.detail-section-heading h3 { margin: 0; color: #eceef0; font-size: 12px; font-weight: 630; }
.detail-section-heading p { margin: 4px 0 0; color: #6f737a; font-size: 10px; }
.tenant-edit-form .form-grid input:disabled {
  opacity: 1;
  border-color: #25272b;
  background: #0f1012;
  color: #aeb1b7;
  cursor: default;
}
.tenant-edit-form.is-editing .form-grid input:not(:disabled) { background: #0b0c0e; color: #f1f2f3; }
.compact-detail-section { padding-bottom: 18px; margin-bottom: 18px; }
.detail-list { display: grid; gap: 8px; }
.detail-list-item { display: grid; gap: 4px; padding: 10px 11px; border: 1px solid #27292e; border-radius: 7px; background: #121315; }
.detail-list-item strong { color: #dfe1e4; font-size: 10px; font-weight: 620; }
.detail-list-item small { color: #70747b; font-size: 9px; line-height: 1.4; }
.detail-empty { color: #666a71; font-size: 10px; }
.timeline-list .detail-list-item { position: relative; padding-left: 14px; border-left: 2px solid #2b2e33; border-radius: 0 7px 7px 0; }
.timeline-list .detail-list-item:first-child { border-left-color: #1877F2; }
.tenant-modal-footer { justify-content: space-between; }
.modal-footer-left,
.modal-footer-right { display: flex; align-items: center; gap: 8px; }
.tenant-link-button {
  display: inline-grid;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.tenant-link-button strong { transition: color .12s ease; }
.tenant-link-button:hover strong { color: #78adf1; }

@media (max-width: 860px) {
  .modal-backdrop { padding: 12px; }
  .system-modal { max-height: calc(100vh - 24px); }
  .tenant-detail-grid { grid-template-columns: 1fr; }
  .tenant-edit-form { border-right: 0; border-bottom: 1px solid #24262a; }
  .tenant-detail-content { max-height: calc(100vh - 205px); }
}
@media (max-width: 560px) {
  .modal-header, .modal-footer { padding: 15px; }
  .modal-body, .tenant-edit-form, .tenant-detail-side { padding: 15px; }
  .tenant-modal-footer { align-items: stretch; flex-direction: column-reverse; }
  .modal-footer-left, .modal-footer-right { width: 100%; }
  .modal-footer-right { justify-content: flex-end; }
  .modal-footer-left .danger-outline { width: 100%; }
}
#action-modal { z-index: 150; }
#tenant-detail-modal { z-index: 130; }

/* ---------- FASE 09-D · legibilidade + servidores ---------- */
/* A subnavegação só pode rolar na horizontal quando os itens não couberem. */
.section-tabs {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #34373d transparent;
}
.section-tabs::-webkit-scrollbar { width: 0; height: 5px; }
.section-tabs::-webkit-scrollbar-track { background: transparent; }
.section-tabs::-webkit-scrollbar-thumb { border-radius: 999px; background: #34373d; }
.section-tabs::-webkit-scrollbar-corner { display: none; }

/* Ações em tabelas precisam respirar; evita "AbrirSuspender" visualmente. */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  text-align: right;
}

/* Passo de legibilidade: textos auxiliares continuam discretos, mas não microscópicos. */
.app-body .section-tab,
.app-body .primary-nav-item,
.app-body .sidebar-toggle { font-size: 12px; }
.app-body .form-grid label,
.app-body .modal-field,
.app-body .danger-outline { font-size: 12px; }
.app-body .data-table th { font-size: 10.5px; }
.app-body .data-table td,
.app-body .data-table td strong { font-size: 13px; }
.app-body .data-table td small,
.app-body .entity-row small,
.app-body .compact-row small,
.app-body .version-row small,
.app-body .detail-list-item small,
.app-body .detail-section-heading p,
.app-body .modal-subtitle,
.app-body .field-help,
.app-body .empty-state p,
.app-body .muted-copy { font-size: 11px; }
.app-body .entity-row strong,
.app-body .compact-row strong,
.app-body .version-row strong,
.app-body .detail-list-item strong,
.app-body .detail-section-heading h3 { font-size: 12px; }
.app-body .table-button,
.app-body .small,
.app-body .status-badge,
.app-body .module-checks legend { font-size: 11px; }
.app-body .stat-card span { font-size: 11px; }
.app-body .floating-menu-heading span,
.app-body .profile-trigger-copy small,
.app-body .profile-menu-user small { font-size: 11px; }
.app-body .empty-notifications p { font-size: 12px; }

.monitoring-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: #858a91;
  font-size: 12px;
  white-space: nowrap;
}
.live-dot,
.server-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #555a62;
}
.live-dot,
.server-status-dot.is-active { background: #1877F2; }

.server-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.monitoring-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, .7fr);
  gap: 12px;
  margin-bottom: 24px;
}
.monitoring-chart-card { min-width: 0; }
.monitoring-note {
  align-content: start;
  background: #0f1012;
}
.monitoring-note h3 { margin: 8px 0 9px; color: #e7e9ec; font-size: 17px; font-weight: 620; }
.monitoring-note p { margin: 0; color: #858a91; font-size: 12px; line-height: 1.6; }
.chart-legend { display: flex; align-items: center; gap: 14px; color: #858a91; font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 2px; border-radius: 2px; background: #1877F2; }
.chart-legend .legend-memory { background: #8a9099; }
.chart-shell { position: relative; min-width: 0; height: 230px; padding-right: 38px; }
.chart-shell canvas { display: block; width: 100%; height: 100%; }
.chart-scale {
  position: absolute;
  inset: 8px 0 18px auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #62676f;
  font-size: 10px;
  pointer-events: none;
}
.section-subheading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.section-subheading h3 { margin: 0 0 4px; color: #e6e8eb; font-size: 16px; font-weight: 620; }
.section-subheading p { margin: 0; color: #7e838a; font-size: 12px; }
.servers-list { display: grid; gap: 12px; }
.server-loading { color: #858a91; font-size: 12px; text-align: center; }
.server-card { padding: 0; overflow: hidden; }
.server-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  border-bottom: 1px solid #24262b;
}
.server-title-row { display: flex; align-items: center; gap: 9px; }
.server-title-row h3 { margin: 0; color: #eff1f3; font-size: 15px; font-weight: 630; }
.server-card-header p { margin: 5px 0 0; color: #747981; font-size: 11px; }
.server-uptime { color: #858a91; font-size: 11px; white-space: nowrap; }
.server-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #24262b;
}
.server-metric-grid > div { display: grid; gap: 5px; padding: 14px 18px; border-right: 1px solid #24262b; }
.server-metric-grid > div:last-child { border-right: 0; }
.server-metric-grid span { color: #747981; font-size: 11px; }
.server-metric-grid strong { color: #e7e9ec; font-size: 15px; font-weight: 630; }
.server-card-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); }
.server-mini-chart { min-width: 0; padding: 17px 18px 20px; border-right: 1px solid #24262b; }
.server-mini-chart canvas { display: block; width: 100%; height: 190px; }
.server-subheading { margin-bottom: 12px; color: #b9bdc3; font-size: 12px; font-weight: 620; }
.server-domains-panel { min-width: 0; padding: 17px 18px 20px; background: #0f1012; }
.server-domain-list { display: grid; gap: 7px; max-height: 250px; overflow: auto; padding-right: 3px; }
.server-domain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid #272a2f;
  border-radius: 7px;
  background: #121315;
}
.server-domain-row > div { min-width: 0; }
.server-domain-row strong { display: block; overflow: hidden; color: #dfe2e6; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.server-domain-row small { display: block; margin-top: 3px; overflow: hidden; color: #747981; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1050px) {
  .server-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitoring-grid { grid-template-columns: 1fr; }
  .server-card-body { grid-template-columns: 1fr; }
  .server-mini-chart { border-right: 0; border-bottom: 1px solid #24262b; }
}
@media (max-width: 620px) {
  .server-summary-grid { grid-template-columns: 1fr 1fr; }
  .server-card-header { flex-direction: column; }
  .server-metric-grid { grid-template-columns: 1fr 1fr; }
  .server-metric-grid > div:nth-child(2) { border-right: 0; }
  .server-metric-grid > div:nth-child(-n+2) { border-bottom: 1px solid #24262b; }
  .chart-legend { display: none; }
}

/* ---------- FASE 09-E · domínios detalhados + correção dos modais ---------- */
/* O cabeçalho e o rodapé ficam fixos dentro do modal; somente o conteúdo central rola. */
.tenant-detail-modal,
.domain-detail-modal {
  display: flex;
  flex-direction: column;
  height: min(860px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
}
.tenant-detail-modal > .modal-header,
.tenant-detail-modal > .modal-footer,
.domain-detail-modal > .modal-header,
.domain-detail-modal > .modal-footer { flex: 0 0 auto; }
.tenant-detail-content,
.domain-detail-content { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
.tenant-modal-footer { position: relative; z-index: 2; }

.monitoring-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: -2px 0 18px;
  border-bottom: 1px solid #24262b;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.monitoring-tabs::-webkit-scrollbar { display: none; }
.monitoring-tab {
  position: relative;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #858a92;
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
  cursor: pointer;
}
.monitoring-tab:hover { color: #d9dce0; }
.monitoring-tab.active { color: #eef0f2; }
.monitoring-tab.active::after { content: ''; position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; background: #1877F2; }
.server-view[hidden] { display: none; }

.domain-directory-card { padding: 0; overflow: hidden; }
.domain-directory-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid #24262b;
}
.domain-directory-toolbar h3 { margin: 0; color: #eef0f2; font-size: 15px; font-weight: 630; }
.domain-directory-toolbar p { margin: 5px 0 0; color: #858a92; font-size: 12px; }
.domain-directory-controls { display: flex; align-items: flex-end; gap: 10px; }
.domain-directory-controls input,
.domain-directory-controls select {
  min-height: 36px;
  border: 1px solid #303238;
  border-radius: 7px;
  outline: none;
  background: #0c0d0f;
  color: #e5e7ea;
  font: inherit;
  font-size: 12px;
}
.domain-directory-controls input { width: min(310px, 36vw); padding: 0 11px; }
.domain-directory-controls select { min-width: 76px; padding: 0 8px; }
.domain-directory-controls input:focus,
.domain-directory-controls select:focus { border-color: #1877F2; }
.domain-directory-controls label { display: grid; gap: 5px; color: #858a92; font-size: 11px; }
.domain-data-table tbody tr { cursor: pointer; }
.domain-data-table tbody tr:hover { background: #13161a; }
.domain-link-button {
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e8eaed;
  text-align: left;
  cursor: pointer;
}
.domain-link-button strong { color: #e8eaed; font-size: 12px; font-weight: 620; }
.domain-link-button small { color: #777c84; font-size: 11px; }
.domain-link-button:hover strong { color: #78adf1; }
.domain-metric-cell { display: grid; gap: 3px; }
.domain-metric-cell strong { color: #dfe2e6; font-size: 12px; font-weight: 610; }
.domain-metric-cell small { color: #737880; font-size: 10px; }
.domain-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid #24262b; color: #7f848c; font-size: 11px; }
.domain-pagination > div { display: flex; gap: 7px; }
.monitoring-footnote { margin: 11px 2px 0; color: #737880; font-size: 11px; line-height: 1.5; }

.domain-detail-modal { width: min(1180px, 100%); }
.domain-modal-header { align-items: flex-start; }
.domain-detail-tabs {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid #24262a;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.domain-detail-tabs::-webkit-scrollbar { display: none; }
.domain-detail-tab {
  position: relative;
  min-height: 45px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: #80858d;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.domain-detail-tab:hover { color: #d5d8dc; }
.domain-detail-tab.active { color: #eef0f2; }
.domain-detail-tab.active::after { content: ''; position: absolute; right: 10px; bottom: -1px; left: 10px; height: 2px; background: #1877F2; }
.domain-detail-content { padding: 20px; }
.domain-tab-panel { min-height: 100%; }
.domain-tab-panel[hidden] { display: none; }
.domain-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.domain-metric-card { min-width: 0; padding: 14px; border: 1px solid #282b30; border-radius: 8px; background: #0f1012; }
.domain-metric-card span { display: block; margin-bottom: 7px; color: #777c84; font-size: 11px; }
.domain-metric-card strong { display: block; overflow: hidden; color: #edf0f3; font-size: 17px; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
.domain-metric-card small { display: block; margin-top: 5px; color: #6d727a; font-size: 10px; }
.domain-overview-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 12px; }
.detail-panel { min-width: 0; padding: 15px; border: 1px solid #282b30; border-radius: 8px; background: #0f1012; }
.detail-panel-heading { margin-bottom: 13px; }
.detail-panel-heading h3 { margin: 0; color: #e9ebee; font-size: 13px; font-weight: 630; }
.detail-panel-heading p { margin: 4px 0 0; color: #747982; font-size: 11px; line-height: 1.45; }
.compact-table { display: grid; gap: 6px; }
.compact-table-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 72px 72px; gap: 8px; align-items: center; padding: 9px 10px; border: 1px solid #25282c; border-radius: 6px; }
.compact-table-row strong { min-width: 0; overflow: hidden; color: #dfe2e6; font-size: 11px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.compact-table-row span { color: #858a92; font-size: 10px; text-align: right; }
.login-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.login-stat { padding: 12px; border: 1px solid #25282c; border-radius: 7px; }
.login-stat span { display: block; color: #767b83; font-size: 10px; }
.login-stat strong { display: block; margin-top: 5px; color: #e6e8eb; font-size: 16px; font-weight: 630; }
.domain-record-list,
.domain-log-list { display: grid; gap: 7px; }
.domain-record,
.domain-log-row { display: grid; gap: 5px; padding: 11px 12px; border: 1px solid #272a2f; border-radius: 7px; background: #0f1012; }
.domain-record-header,
.domain-log-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.domain-record strong,
.domain-log-row strong { color: #e1e4e8; font-size: 11px; font-weight: 620; }
.domain-record span,
.domain-log-row span,
.domain-record small,
.domain-log-row small { color: #777c84; font-size: 10px; line-height: 1.45; }
.domain-log-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.http-status { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border: 1px solid #30343a; border-radius: 999px; color: #aeb3ba; font-size: 10px; }
.http-status.is-error { border-color: #573238; color: #dc949a; }
.domain-modal-footer { justify-content: space-between; }
.modal-footer-note { color: #777c84; font-size: 10px; }

@media (max-width: 900px) {
  .domain-directory-toolbar { align-items: stretch; flex-direction: column; }
  .domain-directory-controls { align-items: stretch; }
  .domain-directory-controls input { width: 100%; }
  .domain-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .domain-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tenant-detail-modal,
  .domain-detail-modal { height: calc(100vh - 24px); max-height: calc(100vh - 24px); }
  .domain-directory-controls { flex-direction: column; }
  .domain-metric-grid { grid-template-columns: 1fr 1fr; }
  .compact-table-row { grid-template-columns: minmax(0, 1fr) 60px; }
  .compact-table-row span:nth-of-type(2), .compact-table-row span:nth-of-type(3) { display: none; }
  .domain-modal-footer { align-items: flex-start; flex-direction: column; }
}
#domain-detail-modal { z-index: 140; }


/* ---------- FASE 09-F · estrutura visual baseada no painel legado HavenSoft ---------- */
:root {
  --app-header-height: 64px;
  --sidebar-expanded-width: 250px;
  --sidebar-collapsed-width: 58px;
  --panel-bg: #171819;
  --panel-surface: #101112;
  --panel-surface-hover: #17191c;
  --panel-surface-2: #0c0d0e;
  --panel-line: #2b2d31;
  --panel-line-soft: #24262a;
  --panel-text: #f1f2f4;
  --panel-muted: #969aa1;
  --panel-radius: 10px;
  font-family: "Google Sans", "Google Sans Text", "Product Sans", "Segoe UI", Arial, sans-serif;
}

body.app-body {
  height: 100vh;
  overflow: hidden;
  background: #090a0b;
  color: var(--panel-text);
}

.app-header {
  position: relative;
  z-index: 100;
  display: grid;
  grid-template-columns: var(--sidebar-expanded-width) minmax(280px, 620px) minmax(280px, 1fr);
  align-items: center;
  gap: 22px;
  height: var(--app-header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--panel-line-soft);
  background: #0d0e0f;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .20);
}

.header-brand-slot {
  display: flex;
  align-items: center;
  min-width: 0;
}
.header-brand {
  display: inline-flex;
  align-items: center;
  padding: 0;
  color: #f5f6f7;
  font-size: 23px;
  font-weight: 300;
  letter-spacing: -.045em;
  white-space: nowrap;
}
.header-brand:hover { color: #fff; }

.header-search {
  justify-self: center;
  width: min(620px, 100%);
  height: 40px;
  border-color: #2a2d31;
  border-radius: 8px;
  background: #131416;
}
.header-search:focus-within {
  border-color: #1877F2;
  background: #15171a;
}
.header-search input { font-size: 13px; }

.header-actions {
  justify-self: end;
}
.header-actions .icon-action {
  border-color: transparent;
  background: transparent;
}
.header-actions .icon-action:hover,
.header-actions .icon-action[aria-expanded="true"] {
  border-color: #2d3035;
  background: #17191c;
}
.header-actions .profile-trigger {
  min-width: 214px;
  height: 50px;
}
.header-actions .profile-trigger:hover,
.header-actions .profile-trigger[aria-expanded="true"] {
  border-color: #2d3035;
  background: #17191c;
}

.app-layout {
  --sidebar-width: var(--sidebar-expanded-width);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 0;
  height: calc(100vh - var(--app-header-height));
  transition: grid-template-columns .18s ease;
}
.app-layout.sidebar-collapsed { --sidebar-width: var(--sidebar-collapsed-width); }

.sidebar,
.sidebar.is-collapsed {
  position: relative;
  top: auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: auto;
  height: 100%;
  padding: 7px 6px;
  overflow: visible;
  border-right: 1px solid var(--panel-line-soft);
  border-bottom: 0;
  background: #0d0e0f;
  box-shadow: 3px 0 12px rgba(0, 0, 0, .10);
}

.sidebar-toggle,
.primary-nav-item {
  min-height: 44px;
  border-radius: 6px;
  font-size: 13px;
}
.sidebar-toggle {
  order: 0;
  margin: 0 0 7px;
  color: #7f848c;
}
.primary-nav {
  order: 1;
  display: grid;
  gap: 5px;
  margin: 0;
}
.primary-nav-item {
  grid-template-columns: 21px minmax(0, 1fr);
  gap: 13px;
  padding: 0 12px;
  border: 0;
  background: #141517;
  color: #a2a6ad;
  font-weight: 540;
}
.primary-nav-item:hover,
.sidebar-toggle:hover {
  background: #1b1d20;
  color: #f0f1f2;
}
.primary-nav-item.active {
  border-color: transparent;
  background: #1877F2;
  color: #fff;
}
.primary-nav-item.active::before { display: none; }
.primary-nav-item svg,
.sidebar-toggle svg { width: 18px; height: 18px; }

.sidebar.is-collapsed .primary-nav-item,
.sidebar.is-collapsed .sidebar-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin-right: auto;
  margin-left: auto;
  padding: 0;
}
.sidebar.is-collapsed [data-tooltip]::after {
  left: calc(100% + 9px);
  padding: 8px 10px;
  border-color: #33363b;
  border-radius: 6px;
  background: #17191c;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .30);
  color: #f1f2f4;
  font-size: 12px;
}

.app-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 18px 20px 28px;
  overflow: auto;
  background: var(--panel-bg);
}

.page-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 54px;
  margin-bottom: 12px;
  padding: 2px 4px 8px;
}
.page-heading-row .eyebrow {
  margin-bottom: 5px;
  color: #7caef0;
  font-size: 11px;
  letter-spacing: .12em;
}
.page-heading-row h1,
.topbar-heading h1 {
  margin: 0;
  color: #f4f5f6;
  font-size: 24px;
  font-weight: 560;
  letter-spacing: -.025em;
}

.section-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: start;
  gap: 4px;
  min-height: 52px;
  margin: 0 0 14px;
  padding: 5px 7px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--panel-line-soft);
  border-radius: var(--panel-radius);
  background: #0f1011;
  scrollbar-width: thin;
}
.section-tabs::-webkit-scrollbar { width: 0; height: 4px; }
.section-tabs::-webkit-scrollbar-track { background: transparent; }
.section-tabs::-webkit-scrollbar-thumb { border-radius: 999px; background: #34373d; }
.section-tab {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 7px;
  color: #a2a6ad;
  font-size: 13px;
  font-weight: 520;
}
.section-tab:hover {
  background: #191b1e;
  color: #f2f3f5;
}
.section-tab.active {
  background: #1877F2;
  color: #fff;
}
.section-tab.active::after { display: none; }

.app-section {
  width: 100%;
  max-width: none;
}
.hero-card,
.content-card,
.stat-card,
.table-card {
  border-color: var(--panel-line);
  border-radius: var(--panel-radius);
  background: var(--panel-surface);
  box-shadow: none;
}
.hero-card {
  padding: 24px;
}
.hero-card::before { display: none; }
.hero-card h2 {
  font-size: 26px;
  font-weight: 560;
}
.hero-card p,
.content-card > p,
.section-toolbar p,
.card-heading p,
.section-subheading p {
  color: var(--panel-muted);
  font-size: 13px;
  line-height: 1.55;
}

.stat-grid { gap: 12px; margin-top: 12px; }
.stat-card { padding: 17px 18px; }
.stat-card span {
  color: #969ba3;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.stat-card strong {
  font-size: 19px;
  font-weight: 590;
}

.content-card { padding: 20px; }

.section-toolbar {
  margin-bottom: 14px;
}
.section-toolbar h2,
.section-heading h2 {
  color: #f2f3f4;
  font-size: 20px;
  font-weight: 570;
}
.section-toolbar p,
.section-heading p { margin-top: 5px; }

.data-table th {
  color: #a3a7ae;
  font-size: 12px;
  font-weight: 580;
}
.data-table td {
  color: #d8dadd;
  font-size: 13px;
}
.data-table tbody tr:hover { background: #16181b; }

button.primary,
a.primary,
.link-button.primary {
  border-color: #1877F2;
  background: #1877F2;
  color: #fff;
  box-shadow: none;
}
button.primary:hover,
a.primary:hover,
.link-button.primary:hover {
  border-color: #2c83f3;
  background: #2c83f3;
}
button.secondary,
a.secondary,
.link-button.secondary {
  border-color: #34373d;
  background: #17191c;
  color: #e2e4e7;
}
button.secondary:hover,
a.secondary:hover,
.link-button.secondary:hover {
  border-color: #454950;
  background: #1d2024;
}

input,
select,
textarea {
  border-color: #34373d;
  border-radius: 6px;
  background: #0c0d0e;
}
input:focus,
select:focus,
textarea:focus { border-color: #1877F2; }

.floating-menu {
  border-color: #33363b;
  border-radius: 8px;
  background: #111214;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .34);
}
.profile-menu {
  width: 350px;
}
.profile-menu-user {
  min-height: 86px;
  padding: 15px 18px;
}
.profile-menu button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 0;
  font-size: 13px;
}
.profile-menu button:hover { background: #1b1d20; }

.system-modal {
  border-color: #35383e;
  border-radius: 9px;
  background: #111214;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .45);
}
.modal-header,
.modal-footer {
  background: #0f1012;
}
.modal-header h2 { font-size: 19px; font-weight: 570; }
.modal-body { background: #111214; }
.modal-message,
.modal-field { font-size: 13px; }

.server-card,
.domain-directory-card,
.detail-panel,
.domain-metric-card,
.domain-record,
.domain-log-row {
  border-color: #2d3035;
  background: #101113;
}
.server-domains-panel { background: #0e0f10; }

.monitoring-tabs {
  min-height: 50px;
  margin: 0 0 14px;
  padding: 5px 7px;
  border: 1px solid var(--panel-line-soft);
  border-radius: var(--panel-radius);
  background: #0f1011;
}
.monitoring-tab {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 13px;
}
.monitoring-tab:hover { background: #191b1e; }
.monitoring-tab.active {
  background: #1877F2;
  color: #fff;
}
.monitoring-tab.active::after { display: none; }

small,
.field-help,
.modal-footer-note,
.domain-record span,
.domain-log-row span,
.domain-record small,
.domain-log-row small {
  font-size: 12px;
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: auto minmax(240px, 1fr) auto;
    gap: 12px;
  }
  .header-brand-slot { min-width: 140px; }
  .profile-trigger-copy { display: none; }
  .header-actions .profile-trigger {
    grid-template-columns: 34px 10px;
    min-width: 54px;
    width: 54px;
    padding-right: 7px;
  }
}

@media (max-width: 820px) {
  body.app-body { overflow: auto; }
  .app-header {
    position: sticky;
    top: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: auto;
    min-height: 62px;
    padding: 9px 12px;
  }
  .header-brand { font-size: 20px; }
  .header-search kbd { display: none; }

  .app-layout,
  .app-layout.sidebar-collapsed {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 62px);
  }
  .sidebar,
  .sidebar.is-collapsed {
    position: sticky;
    top: 62px;
    z-index: 50;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: auto;
    padding: 7px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--panel-line-soft);
  }
  .sidebar-toggle,
  .sidebar.is-collapsed .sidebar-toggle {
    flex: 0 0 42px;
    order: 0;
    width: 42px;
    min-width: 42px;
    margin: 0 4px 0 0;
  }
  .primary-nav,
  .sidebar.is-collapsed .primary-nav {
    display: flex;
    flex: 0 0 auto;
    order: 1;
    gap: 5px;
    margin: 0;
  }
  .primary-nav-item,
  .sidebar.is-collapsed .primary-nav-item {
    grid-template-columns: 18px auto;
    width: auto;
    min-width: max-content;
    margin: 0;
    padding: 0 11px;
  }
  .sidebar.is-collapsed .nav-label { display: inline; }
  .sidebar.is-collapsed [data-tooltip]::after { display: none; }
  .sidebar.is-collapsed .sidebar-toggle svg { transform: rotate(0); }

  .app-main {
    height: auto;
    min-height: calc(100vh - 116px);
    overflow: visible;
    padding: 16px 14px 24px;
  }
}

@media (max-width: 620px) {
  .app-header {
    grid-template-columns: auto 1fr auto;
  }
  .header-search {
    width: 100%;
  }
  .header-search input { font-size: 12px; }
  .topbar-actions { gap: 3px; }
  .icon-action { width: 38px; height: 38px; }
  .header-actions .profile-trigger { height: 40px; }
  .page-heading-row {
    min-height: 46px;
    padding-left: 1px;
    padding-right: 1px;
  }
  .page-heading-row h1 { font-size: 21px; }
  .section-tabs { margin-bottom: 12px; }
}

/* FASE 09-G — duração comercial separada do ciclo de cobrança */
.plan-duration-note,
.subscription-duration-summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid #292c31;
  border-radius: 7px;
  background: #101113;
  color: #8d929a;
  font-size: 11px;
  line-height: 1.45;
}
.plan-duration-note { grid-column: span 1; }
.subscription-duration-summary { align-self: end; }
.status-expired { color: #c58b8b; border-color: #533333; background: #181111; }
@media (max-width: 800px) {
  .plan-duration-note { grid-column: 1 / -1; }
}

/* ---------- FASE 09-I · ajuda contextual + versões comerciais ---------- */
.title-with-help,
.field-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.title-with-help h2,
.title-with-help h3,
.title-with-help h4 { margin: 0; }
.help-trigger {
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid #3a3d43;
  border-radius: 50%;
  background: #15171a;
  color: #9ca2ab;
  font: 600 11px/1 "Google Sans", Arial, sans-serif;
  cursor: pointer;
  vertical-align: middle;
}
.help-trigger:hover,
.help-trigger:focus-visible { border-color: #1877F2; color: #e8f1ff; background: #111a28; outline: none; }
.help-popover {
  position: fixed;
  z-index: 220;
  padding: 15px 38px 15px 15px;
  border: 1px solid #30343a;
  border-radius: 10px;
  background: #111214;
  box-shadow: 0 14px 40px rgba(0,0,0,.28);
  color: #c7cbd2;
  font-size: 13px;
  line-height: 1.55;
}
.help-popover[hidden] { display: none; }
.help-popover p { margin: 0; }
.help-popover-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: #747981;
  font-size: 18px;
  cursor: pointer;
}
.help-popover-close:hover { color: #fff; }

.plan-mode-toggle {
  padding: 14px 15px;
  border: 1px solid #2a2d32;
  border-radius: 9px;
  background: #0d0f11;
}
.plan-mode-toggle .switch-copy { display: flex; align-items: center; gap: 9px; color: #c3c7ce; font-size: 13px; font-weight: 500; }
.plan-mode-toggle input[type="checkbox"] { width: 17px; height: 17px; accent-color: #1877F2; }
.form-grid select:disabled,
.form-grid input:disabled:not([type="checkbox"]) { opacity: .48; cursor: not-allowed; background: #0a0b0d; color: #6d727a; }

.version-row { gap: 10px; }
.version-row-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.version-row-copy strong { color: #f0f2f5; font-size: 13px; }
.version-row-copy small { color: #848992; font-size: 12px; }
.version-row-copy:hover strong { color: #9bc3ff; }
.version-row-actions { display: flex; align-items: center; gap: 7px; }

.version-detail-modal { width: min(1040px, 100%); display: flex; flex-direction: column; max-height: min(860px, calc(100vh - 40px)); }
.version-detail-content { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 20px; }
.version-detail-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.version-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-kv-list { display: grid; }
.detail-kv-row { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid #24272c; }
.detail-kv-row:last-child { border-bottom: 0; }
.detail-kv-row span { color: #858a93; font-size: 12px; }
.detail-kv-row strong { color: #e9ebef; font-size: 12px; font-weight: 560; text-align: right; overflow-wrap: anywhere; }
#version-detail-modal { z-index: 145; }

@media (max-width: 760px) {
  .version-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .version-detail-grid { grid-template-columns: 1fr; }
  .version-row { align-items: flex-start; flex-wrap: wrap; }
  .version-row-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- FASE 10: equipe, usuários e RBAC ---------- */
.access-grid { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(420px, 1.28fr); gap: 16px; align-items: start; }
.access-detail { margin-top: 16px; }
.access-editor { display: grid; gap: 18px; margin-top: 14px; }
.permission-group { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #0d0e10; }
.permission-group > legend, .permission-group > strong { padding: 0 5px; color: var(--text); font-size: 14px; font-weight: 650; }
.permission-check { display: flex; align-items: flex-start; gap: 10px; padding: 9px 5px; color: var(--text-soft); cursor: pointer; }
.permission-check + .permission-check { border-top: 1px solid #1c1d20; }
.permission-check input { margin-top: 3px; accent-color: var(--accent); }
.permission-check span { display: grid; gap: 3px; font-size: 14px; line-height: 1.35; }
.permission-check small { display: block; color: var(--muted); font-size: 12px; font-weight: 450; }
.check-row { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 14px; }
.check-row input { accent-color: var(--accent); }
.data-table td > strong { display: block; font-size: 14px; }
.data-table td > small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
@media (max-width: 980px) { .access-grid { grid-template-columns: 1fr; } }

/* FASE 10-B — padrão de edição em modal e permissões compactas */
#editor-modal { z-index: 125; }
.editor-modal {
  width: min(760px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
}
.editor-modal.is-wide { width: min(1040px, 100%); }
.editor-modal > .modal-header,
.editor-modal > .modal-footer { flex: 0 0 auto; }
.editor-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  background: #111214;
}
.editor-modal-body > .admin-form,
.editor-modal-body > .access-editor,
.editor-modal-body > form {
  width: 100%;
  margin: 0;
}
.editor-modal-body > .admin-form {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.editor-modal-body .form-actions { display: none; }
/* Nos formulários reutilizados, o rodapé do modal executa o submit.
   O gerenciador de assinaturas tem DOIS formulários independentes de exceções
   e usa um rodapé somente com "Fechar": seus botões precisam permanecer visíveis. */
.editor-modal-body .commercial-manager .form-actions { display: flex; }
.editor-modal-footer { justify-content: flex-end; }

/* Checkbox visual compacto; a área clicável continua sendo o label inteiro. */
.check-row input[type="checkbox"],
.permission-check input[type="checkbox"],
.permission-select-all input[type="checkbox"],
.check-option input[type="checkbox"],
.plan-mode-toggle input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px;
  max-height: 16px;
  padding: 0 !important;
  margin: 0;
  flex: 0 0 16px;
  accent-color: var(--accent);
}
.compact-check-row { min-height: 36px; }

.permission-editor { display: grid; gap: 12px; }
.permission-editor-intro { display: grid; gap: 4px; margin-bottom: 2px; }
.permission-editor-intro > strong { font-size: 15px; }
.permission-editor-intro > p,
.permission-summary > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.permission-domain {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d0e10;
}
.permission-domain-header {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.permission-domain-header:hover { background: #131519; }
.permission-domain-header > span:first-child { display: grid; gap: 3px; }
.permission-domain-header strong { font-size: 14px; font-weight: 650; }
.permission-domain-header small { color: var(--muted); font-size: 12px; font-weight: 450; }
.permission-domain-chevron { color: var(--muted); font-size: 18px; }
.permission-domain-body { border-top: 1px solid var(--line); padding: 6px 14px 10px; }
.permission-select-all {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.permission-check {
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
}
.permission-check input[type="checkbox"] { margin-top: 0; }
.permission-check span { flex: 1 1 auto; }
.permission-check span > strong { font-size: 13px; font-weight: 560; color: var(--text); }
.permission-check small { font-size: 11px; }
.role-selector { display: grid; gap: 0; }
.permission-summary { display: grid; gap: 5px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.editor-danger-zone { display: flex; justify-content: flex-start; padding-top: 6px; }

@media (max-width: 720px) {
  .editor-modal,
  .editor-modal.is-wide { height: calc(100vh - 24px); max-height: calc(100vh - 24px); }
  .editor-modal-body { padding: 15px; }
}

.auth-brand-logo {
  display: block;
  max-width: min(280px, 72%);
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}
.mobile-brand .auth-brand-logo { max-width: 190px; max-height: 42px; }

.profile-settings-layout { display: grid; gap: 24px; }
.profile-photo-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.profile-photo-preview { width: 76px; height: 76px; font-size: 20px; }
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-photo-card p { margin: 4px 0 0; color: var(--muted); }
.profile-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.profile-form-grid .span-2 { grid-column: 1 / -1; }
.profile-form-grid .form-actions { display: flex; justify-content: flex-end; }
.file-button { cursor: pointer; }
@media (max-width: 760px) { .profile-photo-card { grid-template-columns: auto 1fr; } .profile-photo-card .button-row { grid-column: 1 / -1; } .profile-form-grid { grid-template-columns: 1fr; } .profile-form-grid .span-2 { grid-column: auto; } }

/* FASE 10-E: padrões globais de imagem, alertas persistentes e gestão comercial */
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.image-edit-card{position:relative;cursor:pointer;color:inherit;font:inherit}
.image-edit-card .image-edit-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:6px;background:rgba(0,0,0,.58);color:#fff;opacity:0;transition:opacity .16s ease;border-radius:inherit;pointer-events:none;font-size:18px}
.image-edit-card .image-edit-overlay small{font-size:11px;font-weight:700}.image-edit-card:hover .image-edit-overlay,.image-edit-card:focus-visible .image-edit-overlay{opacity:1}
.profile-photo-preview.image-edit-card{border:1px solid var(--line);padding:0}
.persistent-notifications{position:fixed;top:66px;right:16px;z-index:160;width:min(420px,calc(100vw - 32px));display:grid;gap:10px;pointer-events:none}
.persistent-notification{pointer-events:auto;display:grid;grid-template-columns:1fr auto;gap:14px;padding:14px 14px 14px 16px;border:1px solid #6f3030;border-left:3px solid #dc4c4c;border-radius:10px;background:var(--panel,#101214);box-shadow:0 14px 34px rgba(0,0,0,.28)}
.persistent-notification strong{display:block;font-size:13px;margin-bottom:4px}.persistent-notification p{margin:0;color:var(--muted,#969ca7);font-size:12px;line-height:1.45}.persistent-notification-close{width:28px;height:28px;border:0;border-radius:7px;background:transparent;color:var(--muted,#969ca7);font-size:20px;cursor:pointer}.persistent-notification-close:hover{background:rgba(255,255,255,.06);color:var(--text,#fff)}
.registration-summary{display:grid;gap:14px}.registration-product{border:1px solid var(--line);border-radius:10px;padding:14px;background:var(--panel-soft,#0d0f11);display:grid;gap:12px}.registration-product-heading{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.registration-product-heading small{color:var(--muted)}.registration-metric-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.registration-metric{border:1px solid var(--line);border-radius:9px;padding:11px;display:grid;gap:6px}.registration-metric-head{display:flex;justify-content:space-between;gap:10px}.registration-metric strong{font-size:14px}.registration-metric small{color:var(--muted);font-size:11px}.usage-bar{height:6px;background:rgba(255,255,255,.07);border-radius:999px;overflow:hidden}.usage-bar>span{display:block;height:100%;background:#1877F2;border-radius:inherit}.registration-metric.is-exceeded .usage-bar>span{background:#dc4c4c}.registration-metric.is-exceeded{border-color:#6f3030}
.commercial-manager{display:grid;gap:16px}.manager-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.manager-summary-card{border:1px solid var(--line);border-radius:9px;padding:11px;display:grid;gap:4px}.manager-summary-card small{color:var(--muted)}.manager-actions{display:flex;flex-wrap:wrap;gap:8px}.manager-section{display:grid;gap:10px;padding-top:12px;border-top:1px solid var(--line)}.manager-section:first-child{padding-top:0;border-top:0}.override-list{display:grid;gap:8px}.override-row{display:flex;justify-content:space-between;gap:12px;align-items:center;border:1px solid var(--line);border-radius:8px;padding:10px}.override-row small{display:block;color:var(--muted)}
.product-manager-danger{border:1px solid #6f3030;border-radius:10px;padding:14px;background:rgba(220,76,76,.03);display:grid;gap:10px}.product-manager-danger p{margin:0;color:var(--muted)}
@media(max-width:760px){.registration-metric-grid,.manager-summary-grid{grid-template-columns:1fr}.persistent-notifications{right:10px;width:calc(100vw - 20px)}}

/* FASE 10-F: editor local de imagem */
.image-editor-backdrop{position:fixed;inset:0;z-index:220;display:grid;place-items:center;padding:20px;background:rgba(0,0,0,.7);backdrop-filter:blur(2px)}.image-editor-backdrop[hidden]{display:none}.image-editor-dialog{width:min(820px,calc(100vw - 32px));max-height:calc(100vh - 40px);display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:var(--panel,#101214);box-shadow:0 24px 70px rgba(0,0,0,.45)}.image-editor-dialog>header,.image-editor-dialog>footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px}.image-editor-dialog>header{border-bottom:1px solid var(--line)}.image-editor-dialog>footer{justify-content:flex-end;border-top:1px solid var(--line)}.image-editor-dialog h2{margin:2px 0 3px;font-size:18px}.image-editor-dialog p{margin:0;color:var(--muted);font-size:12px}.image-editor-eyebrow{color:#1877F2;font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.image-editor-close{width:34px;height:34px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:22px;cursor:pointer}.image-editor-close:hover{background:var(--panel-soft,#15171a);color:var(--text)}.image-editor-body{min-height:0;overflow:auto;display:grid;gap:14px;padding:18px}.image-editor-stage{display:grid;place-items:center;min-height:260px;padding:12px;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:#0a0b0d}.image-editor-stage canvas{display:block;width:min(100%,720px);height:auto;max-height:55vh;border-radius:8px;cursor:grab;touch-action:none;outline:2px solid rgba(24,119,242,.5);outline-offset:2px}.image-editor-stage canvas.is-dragging{cursor:grabbing}.image-editor-zoom{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:12px}.image-editor-zoom span{font-size:12px;font-weight:650}.image-editor-zoom input{width:100%;min-height:0;accent-color:#1877F2}#image-editor-source{color:var(--muted)}@media(max-width:640px){.image-editor-backdrop{padding:8px}.image-editor-dialog{width:100%;max-height:calc(100vh - 16px)}.image-editor-stage{min-height:180px;padding:8px}}

/* ---------- 2FA dentro do painel ---------- */
.twofa-manager { width: min(820px, 100%); }
.twofa-manager-body { display: grid; gap: 18px; }
.twofa-progress { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.twofa-progress li { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 11px; }
.twofa-progress li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 10px; font-weight: 700; }
.twofa-progress li.is-active { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); }
.twofa-progress li.is-active span, .twofa-progress li.is-done span { border-color: var(--accent); background: var(--accent); color: #fff; }
.twofa-panel { display: grid; gap: 18px; }
.twofa-callout, .twofa-success { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.twofa-callout strong, .twofa-success strong { display: block; margin-bottom: 4px; }
.twofa-callout p, .twofa-success p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.twofa-success { border-color: var(--success-line); background: var(--success-bg); }
.twofa-instructions { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.twofa-instructions li { display: grid; grid-template-columns: 32px 1fr; gap: 11px; align-items: start; }
.twofa-instructions li > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); color: var(--accent); font-weight: 800; }
.twofa-instructions strong { display: block; margin-bottom: 3px; }
.twofa-instructions p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.twofa-actions { display: flex; justify-content: flex-end; gap: 8px; }
.twofa-setup-grid { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: center; }
.twofa-qr-box { display: grid; justify-items: center; gap: 8px; }
.twofa-qr { width: 220px; height: 220px; display: grid; place-items: center; padding: 10px; border-radius: 12px; background: #fff; color: #111; }
.twofa-qr svg { width: 100%; height: 100%; display: block; }
.twofa-qr.qr-error { padding: 18px; text-align: center; font-size: 12px; }
.twofa-qr-box small { color: var(--muted); text-align: center; }
.twofa-setup-copy h3, .twofa-verify-form h3, .twofa-active-state h3 { margin: 4px 0 8px; font-size: 18px; }
.twofa-setup-copy p, .twofa-verify-form p, .twofa-active-state p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.twofa-secret-row { display: flex; gap: 8px; align-items: stretch; margin: 14px 0 10px; }
.twofa-secret-row code { flex: 1; min-width: 0; display: flex; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-deep); overflow-wrap: anywhere; font-size: 12px; }
.twofa-verify-form { display: grid; grid-template-columns: 1fr minmax(180px, 240px) auto; gap: 14px; align-items: end; padding-top: 16px; border-top: 1px solid var(--line); }
.twofa-verify-form label { display: grid; gap: 6px; font-size: 11px; }
.twofa-verify-form .otp-input { letter-spacing: .32em; text-align: center; font-size: 18px; }
.twofa-recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.twofa-recovery-codes code { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-deep); text-align: center; letter-spacing: .08em; }
.twofa-active-state { display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: center; }
.twofa-active-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--success-bg); border: 1px solid var(--success-line); color: var(--success); font-size: 24px; font-weight: 800; }
@media (max-width: 720px) { .twofa-progress { grid-template-columns: repeat(2,1fr); }.twofa-setup-grid { grid-template-columns: 1fr; }.twofa-verify-form { grid-template-columns: 1fr; }.twofa-recovery-codes { grid-template-columns: 1fr; } }

/* FASE 10-H: editor 1:1 e histórico de imagens */
.image-editor-stage canvas{max-height:none;object-fit:contain}.image-editor-stage.is-avatar canvas{width:min(100%,520px);aspect-ratio:1/1}.image-editor-stage.is-logo canvas{width:min(100%,720px)}
.image-history-backdrop{position:fixed;inset:0;z-index:225;display:grid;place-items:center;padding:20px;background:rgba(0,0,0,.7);backdrop-filter:blur(2px)}.image-history-backdrop[hidden]{display:none}.image-history-dialog{width:min(920px,calc(100vw - 32px));max-height:calc(100vh - 40px);display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:var(--panel,#101214);box-shadow:0 24px 70px rgba(0,0,0,.45)}.image-history-dialog>header,.image-history-dialog>footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px}.image-history-dialog>header{border-bottom:1px solid var(--line)}.image-history-dialog>footer{justify-content:flex-end;border-top:1px solid var(--line)}.image-history-dialog h2{margin:2px 0 3px;font-size:18px}.image-history-dialog p{margin:0;color:var(--muted);font-size:12px}.image-history-eyebrow{color:#1877F2;font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.image-history-close{width:34px;height:34px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:22px;cursor:pointer}.image-history-close:hover{background:#191b1e;color:var(--text)}.image-history-body{min-height:0;overflow:auto;padding:18px}.image-history-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.image-history-card{display:grid;gap:10px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#111315}.image-history-card.is-active{border-color:#1877F2}.image-history-preview{display:grid;place-items:center;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:#0b0c0e}.image-history-preview.is-avatar{aspect-ratio:1/1}.image-history-preview.is-logo{min-height:180px;aspect-ratio:auto}.image-history-preview img{width:100%;height:100%;object-fit:contain}.image-history-copy{display:grid;gap:3px}.image-history-card-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.image-history-copy>span,.image-history-copy small{color:var(--muted);font-size:11px}.image-history-active{padding:2px 7px;border:1px solid #185fae;border-radius:999px;color:#65a8ff;font-size:10px}.image-history-actions{display:flex;gap:8px;flex-wrap:wrap}.image-history-empty{padding:28px;text-align:center;color:var(--muted)}

/* Domain metrics sorting */
.sortable-domain-heading > button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
}
.sortable-domain-heading > button:hover,
.sortable-domain-heading > button:focus-visible { color: #1877F2; }
.sortable-domain-heading .sort-indicator { font-size: .78rem; opacity: .55; }
.sortable-domain-heading.is-sorted .sort-indicator { color: #1877F2; opacity: 1; }

/* ---------- FASE 10-I · autenticação contextual ---------- */
.auth-system-identity,
.mobile-system-identity { display: grid; justify-items: start; gap: 7px; }
.system-segment { color: var(--muted); font-size: 12px; font-weight: 560; letter-spacing: .01em; }
.mobile-system-identity { display: none; margin-bottom: 36px; }
.mobile-system-identity .mobile-brand { display: inline-flex; margin-bottom: 0; }
.login-information-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 36px; }
.login-information-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.login-information-card.is-primary { grid-column: 1 / -1; border-top: 3px solid var(--accent); }
.login-information-card h2 { margin: 4px 0 8px; color: var(--text); font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.login-information-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.information-kicker { color: var(--accent); font-size: 10px; font-weight: 760; letter-spacing: .11em; text-transform: uppercase; }
.information-action { margin-top: 14px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: transparent; color: var(--text-soft); font-size: 11px; font-weight: 650; }
.information-action:hover { border-color: var(--accent); color: var(--text); }

html[data-auth-theme="light"] {
  --bg: #f4f6f9;
  --bg-deep: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f5;
  --line: #d7dde6;
  --line-strong: #c2cad5;
  --text: #171a1f;
  --text-soft: #343a43;
  --muted: #66707e;
  --muted-2: #8c95a2;
  --danger-bg: #fff4f4;
  --danger-line: #e4a0a0;
  --success-bg: #f1f8f3;
  --success-line: #9fc4aa;
}
html[data-auth-theme="light"] body,
html[data-auth-theme="light"] .auth-shell { background: var(--bg); color: var(--text); }
html[data-auth-theme="light"] .brand-panel { border-right-color: #d8dee7; background: #f7f9fc; }
html[data-auth-theme="light"] .brand-panel::after { border-color: rgba(24,119,242,.15); }
html[data-auth-theme="light"] .form-panel { background: #ffffff; }
html[data-auth-theme="light"] .brand,
html[data-auth-theme="light"] .brand:hover,
html[data-auth-theme="light"] .view h2 { color: #15181d; }
html[data-auth-theme="light"] .brand-copy p,
html[data-auth-theme="light"] .view header p,
html[data-auth-theme="light"] .system-segment { color: #66707e; }
html[data-auth-theme="light"] input { border-color: #ccd3dd; background: #fff; color: #171a1f; }
html[data-auth-theme="light"] input:hover { border-color: #aeb8c5; }
html[data-auth-theme="light"] input:focus { background: #fff; }
html[data-auth-theme="light"] input::placeholder { color: #9aa3af; }
html[data-auth-theme="light"] .ghost-icon { color: #697482; }
html[data-auth-theme="light"] .ghost-icon:hover { color: #171a1f; background: #eef1f5; }
html[data-auth-theme="light"] .check { color: #626d7a; }
html[data-auth-theme="light"] .form-options a { color: #246dc5; }
html[data-auth-theme="light"] .secondary { border-color: #ccd3dd; background: #fff; color: #343a43; }
html[data-auth-theme="light"] .secondary:hover { border-color: #9da9b7; background: #f4f6f9; color: #171a1f; }
html[data-auth-theme="light"] .surface-badge { border-color: #d3d9e2; background: #f7f8fa; color: #5e6875; }
html[data-auth-theme="light"] .login-information-card { background: #fff; }
html[data-auth-theme="light"] .information-action { color: #39424e; }
html[data-auth-theme="light"] .flash { color: #a32626; }
html[data-auth-theme="light"] .flash.success { color: #39714a; }
html[data-auth-theme="light"] .auth-footer,
html[data-auth-theme="light"] .form-footnote { color: #8b94a0; }

/* O QR deve ser imune a regras globais de SVG, especialmente no Church. */
.totp-qr svg,
.twofa-qr svg { display: block; width: 100%; height: 100%; aspect-ratio: 1 / 1; fill: initial; stroke: none !important; stroke-width: 0 !important; shape-rendering: crispEdges; }
.totp-qr svg rect,
.totp-qr svg path,
.twofa-qr svg rect,
.twofa-qr svg path { stroke: none !important; stroke-width: 0 !important; }

/* Mantém a semântica de célula da coluna Ações para a borda atravessar a linha inteira. */
td.table-actions { display: table-cell; text-align: right; white-space: nowrap; }
td.table-actions > .table-button + .table-button { margin-left: 7px; }

@media (max-width: 760px) {
  .mobile-system-identity { display: grid; }
  .mobile-system-identity .mobile-brand { display: inline-flex; }
  .login-information-grid { grid-template-columns: 1fr; }
  .login-information-card.is-primary { grid-column: auto; }
}

html[data-auth-theme="light"] a:hover { color: #154f96; }
html[data-auth-theme="light"] .form-options a:hover,
html[data-auth-theme="light"] .text-button:hover,
html[data-auth-theme="light"] .back-link:hover { color: #154f96; }
@media (max-width: 820px) {
  .mobile-system-identity { display: grid; }
}

/* ---------- FASE 10-J · identidade do login e escala tipográfica ---------- */
:root {
  --font-small: .8rem;
  --font-base: 1rem;
  --font-large: 1.8rem;
  --font-heading: 1.35rem;
}

/* Login: HavenSoft + segmento à esquerda; instituição na primeira linha do formulário. */
.auth-system-identity { gap: 6px; }
.auth-havensoft-brand {
  font-size: 1.35rem;
  font-weight: 420;
  letter-spacing: -.035em;
}
.login-entity-identity {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 30px;
}
.login-entity-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 620;
  letter-spacing: -.025em;
}
.login-entity-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.login-entity-brand .auth-brand-logo {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 42px;
  object-fit: contain;
}
html[data-auth-theme="light"] .auth-havensoft-brand,
html[data-auth-theme="light"] .auth-havensoft-brand:hover { color: var(--accent); }
html[data-auth-theme="light"] .login-entity-brand,
html[data-auth-theme="light"] .login-entity-brand:hover { color: #171a1f; }

/* Escala tipográfica global: .8rem auxiliar, 1rem padrão, até 1.8rem títulos de UI. */
body { font-size: var(--font-base); }
button, input, select, textarea { font-size: var(--font-base); }

/* Autenticação */
.system-segment,
.eyebrow,
.form-kicker,
.information-kicker,
.surface-badge,
.field-error,
.form-options,
.form-options a,
.auth-footer,
.form-footnote,
.footer-link,
.password-hint,
.qr-panel > p,
.qr-panel > small,
.setup-box span,
.trust-list,
.login-information-card p,
.information-action { font-size: var(--font-small); }

.view h2 { font-size: var(--font-large); }
.view header p,
label,
.login-information-card h2,
.brand-copy p { font-size: var(--font-base); }
.brand-copy h1 { font-size: var(--font-large); line-height: 1.08; letter-spacing: -.035em; }

/* Plataforma autenticada */
.app-body { font-size: var(--font-base); }
.app-body button,
.app-body input,
.app-body select,
.app-body textarea,
.app-body .data-table td,
.app-body .data-table td strong,
.app-body .entity-row strong,
.app-body .compact-row strong,
.app-body .version-row strong,
.app-body .form-grid label,
.app-body .modal-message,
.app-body .profile-menu-user strong,
.app-body .floating-menu button { font-size: var(--font-base); }

.app-body small,
.app-body .eyebrow,
.app-body .nav-group-label,
.app-body .data-table th,
.app-body .status-badge,
.app-body .entity-row small,
.app-body .compact-row small,
.app-body .version-row small,
.app-body .muted-copy,
.app-body .field-help,
.app-body .detail-section-heading p,
.app-body .detail-list-item small,
.app-body .detail-empty,
.app-body .session-current,
.app-body .module-checks legend,
.app-body .stat-card span,
.app-body .server-card-header p,
.app-body .server-uptime,
.app-body .server-metric-grid span,
.app-body .server-domain-row small,
.app-body .domain-directory-toolbar p,
.app-body .domain-directory-controls label,
.app-body .domain-link-button small,
.app-body .domain-metric-cell small,
.app-body .chart-legend { font-size: var(--font-small); }

.app-body h1,
.app-body .topbar h1,
.app-body .page-heading h1 { font-size: var(--font-large); }
.app-body h2,
.app-body .hero-card h2,
.app-body .modal-header h2 { font-size: 1.4rem; }
.app-body h3,
.app-body .section-subheading h3,
.app-body .monitoring-note h3,
.app-body .server-title-row h3,
.app-body .domain-directory-toolbar h3,
.app-body .detail-section-heading h3 { font-size: 1.15rem; }

@media (max-width: 760px) {
  .login-entity-identity { margin-bottom: 24px; }
  .login-entity-brand .auth-brand-logo { max-width: 190px; max-height: 38px; }
}

/* Ajustes visuais — header e avatares do painel HavenSoft. */
body.app-body { --app-header-height: 64px; }
.app-header { height: 64px; }
.app-header .header-brand-slot { min-height: 52px; }
.app-header .header-brand img { display: block; max-width: 220px; max-height: 52px; width: auto; height: auto; object-fit: contain; }
.app-header .header-actions .profile-trigger { height: 54px; }
.app-header .profile-trigger > .user-avatar { width: 44px; height: 44px; }
.app-header .profile-menu .user-avatar.large { width: 66px; height: 66px; }
/* Painel administrativo: evitar bordas claras nos cards sobre o fundo escuro. */
body.app-body .hero-card,
body.app-body .content-card,
body.app-body .stat-card,
body.app-body .table-card,
body.app-body .server-card,
body.app-body .domain-directory-card,
body.app-body .domain-metric-card,
body.app-body .profile-photo-card {
  border-color: transparent;
}
@media (max-width: 820px) {
  .app-header { height: 64px; min-height: 64px; padding-top: 0; padding-bottom: 0; }
}
@media (max-width: 620px) {
  .app-header .header-actions .profile-trigger { height: 52px; }
}


/* Correção: logos 1:1 devem caber inteiros no editor, sem rolagem/corte visual. */
.image-editor-stage.is-square-logo { min-height:0; }
.image-editor-stage.is-square-logo canvas {
  width:min(100%, 520px, 46vh);
  max-width:100%; max-height:46vh; height:auto;
  aspect-ratio:1 / 1; object-fit:contain;
}
@media(max-height:650px) {
  .image-editor-stage.is-square-logo canvas { width:min(100%, 300px, 38vh); max-height:38vh; }
}


/* PNG transparente: prévias claras quadriculadas para não parecer fundo preto
   no modo escuro. O quadriculado é somente visual, nunca gravado no PNG. */
.image-editor-stage,
.image-history-preview.is-logo,
.logo-preview {
  background-color: #f8fafc;
  background-image:
    linear-gradient(45deg, #e5eaf1 25%, transparent 25%, transparent 75%, #e5eaf1 75%),
    linear-gradient(45deg, #e5eaf1 25%, transparent 25%, transparent 75%, #e5eaf1 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}
.image-editor-stage canvas { background: transparent; }


/* TRANSPARÊNCIA REAL (PNG) — o fundo pertence ao elemento CSS, jamais ao bitmap.
 * Cinzas de contraste médio evitam parecer que o PNG ganhou um fundo branco/preto.
 * Aplicável tanto ao preview do logo quanto às fotos e histórico. */
.image-editor-stage,
.image-history-preview,
.logo-preview,
.profile-photo-large,
.profile-photo-preview,
.avatar-editor-preview {
  background-color: #b6bdc7;
  background-image:
    linear-gradient(45deg, #e2e6ec 25%, transparent 25%, transparent 75%, #e2e6ec 75%),
    linear-gradient(45deg, #e2e6ec 25%, transparent 25%, transparent 75%, #e2e6ec 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}
.image-editor-stage canvas, .image-editor-stage img { background: transparent; }

/* Fase 10K — gestão de módulos e catálogo de permissões reais. */
.app-body .module-row-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.app-body .module-permissions-section{display:grid;gap:12px}
.app-body .module-permission-group{display:grid;gap:6px;padding:12px;border:1px solid var(--line);border-radius:9px}
.app-body .module-permission-group>strong{font-size:12px;color:var(--text)}
.app-body .module-permission-line{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;border-top:1px solid var(--line)}
.app-body .module-permission-line>span:first-child{min-width:0;overflow-wrap:anywhere}
.app-body .module-permission-line strong{display:block;font-size:11px}
.app-body .module-permission-line small{display:block;font-size:10px;color:var(--muted);margin-top:3px}
.app-body .module-permission-tags{display:flex;gap:5px;justify-content:flex-end;flex-wrap:wrap}
.app-body .module-permission-tag{font-size:10px;border:1px solid var(--line);border-radius:15px;padding:4px 7px;white-space:nowrap}
.app-body .module-permission-tag.is-missing{border-color:#ae7d22;color:#b68c30}
.app-body .module-permission-note{font-size:11px;color:var(--muted);padding:12px;border-radius:8px;border:1px dashed var(--line)}
@media(max-width:720px){.app-body .module-permission-line{align-items:flex-start;flex-direction:column}.app-body .module-permission-tags{justify-content:flex-start}}

/* Layout consistente: modais principais aproximadamente 15% mais amplos sem ultrapassar viewport. */
@media (min-width: 769px) {
  .system-modal:not(.domain-detail-modal):not(.tenant-detail-modal):not(.version-detail-modal):not(.editor-modal):not(.action-modal) { width: min(621px, 100%); }
  .editor-modal { width: min(874px, 100%); }
  .editor-modal.is-wide { width: min(1196px, 100%); }
  .tenant-detail-modal { width: min(1288px, 100%); }
  .domain-detail-modal { width: min(1357px, 100%); }
  .version-detail-modal { width: min(1196px, 100%); }
}
.registration-product-heading > div:first-child { display: grid; gap: 5px; min-width: 0; }
.registration-product-heading > div:first-child > strong { display: block; }
.registration-product-heading > div:first-child > small { display: block; margin-top: 0; }

/* Filtros de logs e auditoria do domínio, compactos e adaptáveis. */
.history-filter-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:10px;align-items:end;padding:12px;margin:0 0 12px;background:var(--panel-soft,#101215);border:1px solid var(--line,#2d3036);border-radius:9px; }
.history-filter-grid label { display:grid;gap:5px;min-width:0;font-size:11px;color:var(--muted,#888); }
.history-filter-grid input,.history-filter-grid select { min-width:0;width:100%;height:36px;padding:0 9px;border:1px solid var(--line,#35383c);border-radius:6px;background:var(--surface,#0c0d10);color:var(--text,#eee);font:inherit;font-size:12px; }
.history-filter-grid input:focus,.history-filter-grid select:focus { outline:2px solid #1877f2;outline-offset:1px; }
.history-actions {display:flex;gap:8px;align-items:end;flex-wrap:wrap;}
.history-filter-meta { color:var(--muted,#999);font-size:11px;margin:10px 0; }
.history-pagination {display:flex;justify-content:flex-end;gap:8px;margin:13px 0 2px;}
.history-pagination button:disabled {opacity:.45;cursor:not-allowed;}
@media(max-width:600px){.history-filter-grid{grid-template-columns:1fr 1fr;}.history-actions{grid-column:1 / -1;}}
.history-filter-grid [data-tenant-only][hidden] { display:none; }


/* Fase 11 — barras de filtros: controles uniformes e sem saltos verticais. */
.domain-directory-toolbar { display:grid;grid-template-columns:minmax(220px,1fr) minmax(0,auto);align-items:end;gap:18px; }
.domain-directory-toolbar > div:first-child { align-self:end;min-width:0; }
.domain-directory-controls {display:flex;align-items:end;gap:10px;flex-wrap:wrap;min-width:0;}
.domain-directory-controls > input,.domain-directory-controls > select,
.domain-directory-controls > label > select {height:38px;min-height:38px;margin:0;box-sizing:border-box;}
.domain-directory-controls > label {display:flex;flex-direction:column;justify-content:end;gap:5px;margin:0;min-height:57px;white-space:nowrap;}
.domain-directory-controls > input,.domain-directory-controls > select {align-self:end;}
.domain-directory-controls > label > select {width:100%;}
@media (max-width:1060px) {
  .domain-directory-toolbar {grid-template-columns:1fr;align-items:stretch;}
  .domain-directory-controls {justify-content:flex-start;}
  .domain-directory-controls > input {width:min(310px,100%);flex:1 1 230px;}
}
@media (max-width:600px) {
  .domain-directory-controls {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
  .domain-directory-controls > input {grid-column:1/-1;width:100%;}
  .domain-directory-controls > label {min-height:auto;}
}

/* O form preserva uma linha compacta para ajuda e erro, inclusive em grades. */
.app-body .form-grid > label {min-width:0;align-self:start;}
.app-body .form-grid label .hs-field-feedback {margin-top:2px;}
.app-body .hs-field-feedback.has-help {color:var(--muted,#858a92);text-overflow:ellipsis;}
.app-body .hs-domain-entry > small[hidden] {display:none!important;}

/* Navegação de instituições dentro do detalhe do cliente. */
.client-workspace {display:grid;grid-template-columns:minmax(200px,240px) minmax(0,1fr);gap:16px;min-height:340px;align-items:stretch;}
.client-institution-aside {display:flex;flex-direction:column;gap:8px;min-width:0;border-right:1px solid var(--line,#303238);padding-right:14px;}
.client-institution-list {min-height:0;max-height:52vh;overflow-y:auto;display:grid;align-content:start;gap:6px;}
.client-institution-option {width:100%;min-height:38px;border:1px solid transparent;border-radius:8px;background:transparent;color:inherit;text-align:left;padding:8px 10px;cursor:pointer;overflow-wrap:anywhere;}
.client-institution-option:hover {background:var(--surface-2,#1d2026);}
.client-institution-option[aria-current="true"] {background:color-mix(in srgb,#1877f2 12%,transparent);border-color:#1877f2;color:inherit;}
.client-institution-new {display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;}
.client-institution-panel {min-width:0;display:grid;align-content:start;gap:14px;}
.client-institution-panel .admin-form {padding:0;background:transparent;border:0;box-shadow:none;}
@media (max-width:690px) {.client-workspace {grid-template-columns:1fr;}.client-institution-aside {border-right:0;border-bottom:1px solid var(--line,#303238);padding:0 0 12px;}.client-institution-list {display:flex;max-height:125px;overflow-x:auto;}.client-institution-option {min-width:140px;}.client-institution-panel .form-grid.two {grid-template-columns:1fr;}}
/* Input agrupado não cria uma linha fantasma pela baseline de inline-block. */
.app-body .hs-domain-entry {display:block;min-width:0;line-height:normal;}
.app-body .hs-domain-entry > input {display:block;width:100%;margin:0;}
.app-body .form-grid input:not([type="checkbox"]):not([type="radio"]),
.app-body .form-grid select {height:40px;min-height:40px;box-sizing:border-box;}

/* Fase 11 — catálogo independente, cards e navegação modal por contexto */
.catalog-home-cards { display:grid; grid-template-columns:repeat(2,minmax(0,340px));gap:14px;margin:24px 0 14px; }
.catalog-home-card { display:grid;grid-template-columns:42px minmax(0,1fr) 16px;align-items:center;gap:12px;min-height:132px;padding:18px;border:1px solid #323740;border-radius:13px;background:#17191d;text-align:left;color:#eef2f7;cursor:pointer; }
.catalog-home-card:hover,.catalog-home-card:focus-visible { border-color:#1877f2;box-shadow:0 0 0 1px rgba(24,119,242,.2); }
.catalog-home-card>span:nth-child(2) {display:grid;gap:6px;}
.catalog-home-card strong{font-size:15px}.catalog-home-card small{font-size:11px;color:#a2a9b4}.catalog-home-count{font-size:10px;color:#8fbaff;margin-top:4px}
.catalog-home-icon {width:40px;height:40px;display:grid;place-items:center;border-radius:10px;background:#1b3357;color:#7eaff4;font-size:23px}
.catalog-home-arrow {font-size:25px;color:#8b9cb5}
#catalog-browser-modal .catalog-browser {width:min(1160px,calc(100vw - 28px));max-height:calc(100dvh - 32px);min-height:min(620px,calc(100dvh - 32px));}
.catalog-browser-layout{display:grid;grid-template-columns:minmax(220px,260px) minmax(0,1fr);min-height:0;overflow:hidden;}
.catalog-browser-aside {padding:20px 16px;border-right:1px solid #2d3036;display:grid;gap:14px;align-content:start;overflow-y:auto;min-height:0;background:#151619;}
.catalog-browser-aside h3{font-size:13px;margin:0 0 4px}.catalog-browser-aside label{display:grid;gap:6px;font-size:11px;color:#aeb4bd;min-width:0}
.catalog-browser-aside input,.catalog-browser-aside select{width:100%;min-width:0;min-height:38px;}
.catalog-browser-main{overflow-y:auto;min-height:0;padding:20px;}
.catalog-browser-panel{display:grid;gap:15px;align-content:start;}
.catalog-entity-list {display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:11px;align-content:start;}
.catalog-entity-list .entity-row{min-height:94px;padding:14px;align-items:center;}
.catalog-entity-list .entity-row strong {font-size:13px}.catalog-entity-list .entity-row small{font-size:11px;line-height:1.5}
.catalog-detail-workspace{margin-top:6px;min-width:0;}
.catalog-product-tabs{display:flex;flex-wrap:wrap;gap:6px;border-bottom:1px solid #2b2e34;padding-bottom:12px;margin-bottom:20px}
.catalog-product-tabs button{background:transparent;color:#aeb4bd;padding:9px 12px;border:1px solid transparent;border-radius:8px;font-size:11px;cursor:pointer}
.catalog-product-tabs button.active{color:#fff;background:#1556b5}.catalog-product-tabs button:focus-visible{outline:2px solid #1877f2}
.catalog-detail-workspace [data-catalog-panel]{display:grid;gap:12px;align-content:start;}
.catalog-detail-workspace [data-catalog-panel][hidden]{display:none!important}
.catalog-browser .modal-footer{justify-content:space-between}
@media(max-width:800px){.catalog-home-cards{grid-template-columns:1fr}.catalog-browser-layout{grid-template-columns:1fr;overflow-y:auto}.catalog-browser-aside{border-right:0;border-bottom:1px solid #2d3036;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;overflow:visible;padding:12px}.catalog-browser-aside h3,.catalog-browser-aside p{display:none}.catalog-browser-main{overflow:visible;padding:15px}.catalog-entity-list{grid-template-columns:1fr}}
@media(max-width:500px){.catalog-browser-aside{grid-template-columns:repeat(2,minmax(0,1fr))}.catalog-browser .modal-header{padding:12px}}
#catalog-browser-modal .catalog-browser{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:min(830px,calc(100dvh - 32px));}
@media(max-width:800px){.catalog-browser-layout{grid-template-rows:max-content minmax(0,1fr);overflow:hidden}.catalog-browser-aside{align-content:start}.catalog-browser-main{overflow-y:auto;min-height:0}}

/* Fase 11 — detalhe do catálogo: navegação fixa à esquerda e conteúdo à direita.
   Importante: regras autorais de display não podem reexibir painéis com hidden. */
#catalog-browser-modal .catalog-browser [hidden] {display:none!important}
#catalog-browser-modal .catalog-browser-header-heading {display:flex;align-items:center;gap:17px;min-width:0}
#catalog-browser-modal .catalog-browser-header-heading > div {min-width:0}
#catalog-browser-modal .catalog-browser-back {flex:0 0 44px;display:grid;place-items:center;width:44px;height:44px;padding:0;background:transparent;border:0;border-radius:10px;color:var(--text-primary,#eef1f5);font-size:36px;line-height:1;cursor:pointer}
#catalog-browser-modal .catalog-browser-back:hover {background:rgba(255,255,255,.07)}
#catalog-browser-modal .catalog-browser-back:focus-visible {outline:2px solid #277bf3;outline-offset:2px}
#catalog-browser-modal .catalog-browser-layout.is-detail {grid-template-columns:minmax(200px,236px) minmax(0,1fr);gap:12px;padding:14px;background:#101114}
#catalog-browser-modal .catalog-detail-aside {display:flex;flex-direction:column;align-items:stretch;gap:10px;min-width:0;min-height:0;padding:14px 12px;border:0;border-radius:20px;background:#17191c;overflow-y:auto}
#catalog-browser-modal .catalog-section-nav {display:flex;align-items:center;gap:12px;min-width:0;min-height:48px;padding:11px 13px;border:1px solid transparent;border-radius:14px;background:#101113;color:#e6e9ee;font-size:13px;font-weight:600;text-align:left;cursor:pointer;white-space:normal}
#catalog-browser-modal .catalog-section-nav:hover {background:#222830;border-color:#333c48}
#catalog-browser-modal .catalog-section-nav.active {background:#163d79;border-color:#277bf3;color:#fff}
#catalog-browser-modal .catalog-section-nav:focus-visible {outline:2px solid #277bf3;outline-offset:2px}
#catalog-browser-modal .catalog-section-icon {display:inline-flex;justify-content:center;flex:0 0 19px;font-size:19px;font-weight:400}
#catalog-browser-modal .catalog-browser-layout.is-detail .catalog-browser-main {min-width:0;min-height:0;margin:0;padding:22px 24px;border-radius:20px;background:#17191c;overflow-y:auto}
#catalog-browser-modal .catalog-browser-layout.is-detail .catalog-browser-panel {min-width:0}
#catalog-browser-modal .catalog-detail-workspace {margin-top:0}
#catalog-browser-modal .catalog-detail-workspace .card-heading {align-items:center;gap:16px;flex-wrap:wrap}
@media(max-width:800px){
  #catalog-browser-modal .catalog-browser-layout.is-detail {grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:9px;padding:8px;overflow:hidden}
  #catalog-browser-modal .catalog-detail-aside {flex-direction:row;gap:8px;padding:8px;border-radius:13px;overflow-x:auto;overflow-y:hidden}
  #catalog-browser-modal .catalog-section-nav {flex:0 0 auto;min-height:42px;white-space:nowrap;padding:9px 11px;border-radius:10px}
  #catalog-browser-modal .catalog-browser-layout.is-detail .catalog-browser-main {padding:14px;overflow-y:auto;border-radius:13px}
}
@media(max-width:500px){
  #catalog-browser-modal .catalog-browser-header-heading {gap:8px}
  #catalog-browser-modal .catalog-browser-back {flex-basis:32px;width:32px;height:38px;font-size:30px}
  #catalog-browser-modal .catalog-section-nav {gap:6px;font-size:11px}
  #catalog-browser-modal .catalog-section-icon {flex-basis:16px;font-size:16px}
}

#catalog-browser-modal .catalog-section-icon {width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

/* Fase 11 — controles de imagem: overlay apenas com lápis, sem texto. */
.image-edit-card .image-edit-overlay { gap:0; }
.image-edit-card .image-edit-pencil { box-sizing:content-box;width:22px;height:22px;display:block;flex:0 0 auto;padding:7px;border-radius:50%;background:rgba(0,0,0,.78);pointer-events:none; }

/* Menu de perfil — a coluna do avatar acompanha o tamanho real (66px).
   A grid anterior reservava 42px e desenhava o avatar sobre o nome. */
.app-header .profile-menu .profile-menu-user {
  display:grid;grid-template-columns:66px minmax(0,1fr);align-items:center;gap:12px;min-width:0;
}
.app-header .profile-menu .profile-menu-user > .user-avatar.large {
  width:66px;height:66px;min-width:66px;flex:none;
}
.app-header .profile-menu .profile-menu-user > div {min-width:0;max-width:100%;overflow:hidden;}
.app-header .profile-menu .profile-menu-user strong,
.app-header .profile-menu .profile-menu-user small {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* O botão voltar usa um SVG, não um caractere tipográfico. */
#catalog-browser-modal .catalog-browser-back .catalog-back-icon {
  display:block;width:24px;height:24px;pointer-events:none;
}
@media(max-width:500px){
  #catalog-browser-modal .catalog-browser-back .catalog-back-icon {width:22px;height:22px;}
}

/* Hotfix Fase 11 — gap de domínios e revisão de contornos decorativos. */
.client-domains-list{display:grid;gap:10px;align-content:start}
.client-domains-list>.entity-row,.client-domains-list>.detail-list-item{margin:0}
/* Preservar bordas dos inputs, foco, badges e feedback funcional. Remover somente contornos de superficies no dark mode. */
html[data-theme="dark"] .client-domains-list>.entity-row,
html[data-theme="dark"] .client-institution-panel,
html[data-theme="dark"] .client-institution-aside,
html[data-theme="dark"] .catalog-card,
html[data-theme="dark"] .catalog-browser-main,
html[data-theme="dark"] .catalog-detail-aside,
html[data-theme="dark"] .editor-form>.content-card{border-color:transparent!important}

/* Superficies novas da Plataforma: contorno suprimido no tema escuro. */
.client-domains-list>.detail-list-item,.client-domains-list>.entity-row {border-color:transparent!important}

/* Erro de formulário no rodapé: mantém o botão de salvar visível sem falha silenciosa. */
.editor-modal-form-error{flex:1 1 220px;color:var(--color-danger,#e88888);font-size:12px;line-height:1.45;min-width:0}
.editor-modal-form-error[hidden]{display:none!important}

/* Fase 11: domínios operacionais separados do histórico sem bordas decorativas. */
#tenant-domains-list .domain-history-block { margin-top: 9px; }
#tenant-domains-list .domain-history-block > summary { cursor: pointer; font-size: 11px; padding: 7px 3px; color: var(--muted, #9297a0); }
#tenant-domains-list .domain-history-list { margin-top: 8px; opacity: .83; }
#tenant-domains-list .domain-history-list .detail-list-item { background: transparent; }
#tenant-domains-list .detail-list-item + .detail-list-item { margin-top: 2px; }

/* Fase 11 — erros de ações comerciais permanecem visíveis no card correspondente. */
.domain-operation-error { margin:8px 0 0; padding:8px 10px; border-radius:7px;
  background:rgba(208,58,74,.09); color:var(--error, #d34959);
  font-size:12px; line-height:1.45; overflow-wrap:anywhere; }
html[data-theme="dark"] .domain-operation-error { color:#ff999f; background:rgba(229,63,78,.12); }

/* Fase 11: erro de 2FA fica dentro do modal, sem perder motivo ou contexto. */
#action-modal-totp-error { overflow-wrap:anywhere; white-space:normal; line-height:1.45; }
#action-modal-totp.is-invalid { border-color:var(--danger,#d45454) !important; }
.action-modal-operation-error { color:var(--danger,#eb7777); font-size:12px; line-height:1.45; overflow-wrap:anywhere; }
#action-modal-operation-error[hidden], #action-modal-totp-error[hidden], #action-modal-totp-help[hidden] { display:none !important; }

/* Login 2FA — escolha simples, sem campos de validade expostos. */
#totp-form .trusted-device-choice{display:flex;align-items:center;gap:10px;margin:8px 0 14px;font-size:13px;cursor:pointer}
#totp-form .trusted-device-choice input[type="checkbox"]{width:17px;min-width:17px;height:17px;min-height:17px;padding:0;margin:0;accent-color:var(--accent);cursor:pointer}
