@font-face {
  font-family: "Open Sans";
  src: url("fonts/open-sans-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Open Sans";
  src: url("fonts/open-sans-semibold.ttf") format("truetype");
  font-weight: 500 800;
  font-display: swap;
}
:root {
  --shell-header-height: 84px;
  color-scheme: light;
  --purple: #29235e;
  --blue: #2454a4;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #d8e0eb;
  --bg: #f8fafc;
  --lilac: #e5e1f7;
  --radius: 14px;
  --status-active: #146c43;
  --status-inactive: #b42318;
  --status-dot-size: 14px;
  --status-name-gap: 10px;
  font:
    14px/1.6 "Open Sans",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
a {
  cursor: pointer;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 600;
  color: var(--purple);
  line-height: 1.3;
}
h1 {
  font-size: 26px;
}
h2 {
  font-size: 17px;
}
h3 {
  font-size: 15px;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 12px;
}
strong {
  font-weight: 600;
}
code,
pre {
  font-family: Consolas, monospace;
  font-size: 12px;
}
pre {
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f3f5fa;
  padding: 20px;
  border-radius: 8px;
  color: #29235e;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: none;
}
a:focus-visible,
button:focus-visible { filter: brightness(.85); }
[hidden] {
  display: none !important;
}
.skip {
  position: fixed;
  top: -70px;
  left: 16px;
  z-index: 90;
  background: white;
  padding: 12px;
}
.skip:focus {
  top: 12px;
}
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--purple);
  font-weight: 600;
  font-size: 19px;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: var(--lilac);
  width: 38px;
  height: 42px;
  border-radius: 10px;
}
.brand-mark .icon {
  width: 25px;
  height: 25px;
}
.brand span small {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--muted);
  line-height: 1.1;
}
.sidebar {
  width: var(--sidebar-width, 248px);
  position: fixed;
  inset: var(--shell-header-height) auto 0 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  z-index: 30;
  overflow: auto;
}
.nav-group {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--muted);
  text-transform: uppercase;
  padding: 20px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--muted);
  margin: 20px 12px 10px;
  text-transform: uppercase;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  min-height: 44px;
  margin: 3px 0;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  border: 1px solid transparent;
}
.nav-link:hover {
  background: #f3f5fa;
  text-decoration: none;
  color: var(--purple);
}
.nav-link > .icon { color: #38a7e8; }
.nav-link[aria-current="page"] {
  background: #eeedf6;
  border-color: #dedbea;
  color: var(--purple);
  font-weight: 600;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 24px 12px 0;
}
.sidebar-note {
  background: #f6f4fc;
  border: 1px solid #e5e1f7;
  border-radius: 10px;
  padding: 14px;
  font-size: 12px;
  color: #453879;
}
.sidebar-note p {
  margin: 6px 0 12px;
}
.workspace {
  margin-left: var(--sidebar-width, 248px);
  min-width: 0;
  padding-top: var(--shell-header-height);
}
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--shell-header-height);
  min-height: var(--shell-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--purple);
  color: #fff;
  border-bottom: 1px solid #ffffff20;
  padding: 16px 32px;
}
.topbar-brand { display:flex; align-items:center; gap:20px; min-width:0; }
.header-brand { display:flex; flex-shrink:0; }
.header-brand:hover { text-decoration:none; }
.topbar .brand { color:#fff; }
.topbar .brand span small { color:#c4c2da; }
.topbar .brand-mark { background:#ffffff14; }
.header-context { display:flex; flex-direction:column; gap:3px; padding-left:20px; border-left:1px solid #ffffff20; min-width:0; }
.header-context strong { font-size:13px; font-weight:600; }
.header-context small, .topbar .identity small { color:#c4c2da; font-size:10px; }
.topbar .text-button { color:#eeeafa; }
.topbar a:focus-visible, .topbar button:focus-visible { background: #ffffff14; }
.topbar .mobile-toggle { background:#ffffff14; border-color:#ffffff30; color:#fff; }
.topbar .mobile-toggle:hover { background:#ffffff25; }
.mobile-area-switch { display:none; }
.demo-controls { display:flex; justify-content:flex-end; margin-bottom:16px; }
.topbar-left,
.topbar-right,
.row,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}
.topbar-right {
  justify-content: flex-end;
  gap: 18px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.header-symbol { display: grid; place-items: center; width: 48px; height: 48px; color: #fff; }
.header-symbol .icon { width: 36px; height: 36px; }
.topbar-brand { gap: 16px; flex: 1; }
.header-context { border: 0; padding: 0; gap: 4px; }
.header-context strong, .header-context small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.header-home, .header-notifications { display: flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 7px; }
.header-home:hover { background: #ffffff10; }
.account-menu { position: relative; }
.avatar-button { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; color: #fff; }
.topbar .avatar { border: 1px solid #ffffff25; background: #ffffff0d; color: #fff; }
.account-chevron { display: flex; transform: rotate(90deg); }
.account-chevron .icon { width: 14px; height: 14px; }
.account-options { position: absolute; right: 0; top: calc(100% + 15px); width: 210px; max-width: calc(100vw - 24px); padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 12px 36px #17213d15; color: var(--ink); font-size: 12px; line-height: 1.6; }
.account-options .menu-link { display: flex; align-items: center; gap: 10px; min-height: 44px; width: 100%; padding: 11px 12px; border: 0; border-radius: 6px; background: none; color: var(--ink); font-size: 12px; font-weight: 400; white-space: normal; text-align: left; }
.account-options .menu-link:hover, .account-options .menu-link:focus-visible { background: var(--bg); }
.account-options .account-signout { margin-top: 5px; padding-top: 14px; border-top: 1px solid #eef1f5; border-radius: 0; color: #b42318; }
.account-options .account-signout .icon { width: 18px; height: 18px; }
.avatar {
  width: 36px;
  height: 36px;
  background: var(--lilac);
  color: var(--purple);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}
.identity {
  font-size: 12px;
}
.identity small {
  display: block;
}
.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #e9d6a4;
  color: #80530e;
  background: #fff9e9;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.main {
  max-width: 1536px;
  margin: auto;
  padding: 28px 32px 32px;
  min-height: calc(100vh - 150px);
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 7px;
}
.breadcrumb {
  font-size: 11px;
  color: var(--muted);
  margin-top: 9px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--purple);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
}
.btn:hover {
  background: #f3f5fa;
  text-decoration: none;
}
.btn.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn.primary:hover {
  background: #1c478e;
}
.btn.secondary {
  background: var(--lilac);
  color: #453879;
  border-color: #d4cdef;
}
.btn.secondary:hover { background: #d8d2f2; border-color: #d4cdef; }
.btn.danger {
  color: #fff;
  background: #b42318;
  border-color: #b42318;
}
.btn.danger:hover { background: #912018; border-color: #912018; }
.btn.compact {
  min-height: 36px;
  padding: 6px 11px;
  font-size: 12px;
}
.page-actions .btn {
  min-height: 40px;
  font-size: 12px;
  padding: 8px 14px;
}
.btn .icon {
  width: 16px;
  height: 16px;
}
.text-button {
  background: none;
  border: 0;
  color: var(--blue);
  padding: 6px;
  font-size: 12px;
}
.mobile-toggle,
.mobile-close {
  display: none;
}
.notice {
  border: 1px solid;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  margin-bottom: 22px;
  overflow-wrap: anywhere;
}
.notice.info {
  background: #cff4fc;
  border-color: #9eeaf9;
  color: #055160;
}
.notice.warning {
  background: #fff3cd;
  border-color: #ffe69c;
  color: #664d03;
}
.notice.success {
  background: #d1e7dd;
  border-color: #a3cfbb;
  color: #0a3622;
}
.notice.danger {
  background: #f8d7da;
  border-color: #f1aeb5;
  color: #58151c;
}
.notice .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.notice p {
  flex: 1;
}
.section-label {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 20px #152b4a05;
  min-width: 0;
  margin-bottom: 24px;
  overflow: hidden;
}
.panel-body {
  padding: 24px 28px;
}
.panel-head {
  padding: 20px 24px;
  border-bottom: 1px solid #edf0f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.kpi.featured {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.kpi.featured .kpi-top,
.kpi.featured small {
  color: #d9d4f5;
}
.kpi-value {
  font-size: 27px;
  line-height: 1.3;
  font-weight: 600;
  margin: 15px 0 7px;
  color: var(--purple);
}
.kpi.featured .kpi-value {
  color: #fff;
}
.kpi small {
  font-size: 10px;
}
.kpi-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f1fb;
  color: #6b5aaa;
}
.featured .kpi-icon {
  background: #ffffff18;
  color: #fff;
}
.channel-facts { margin: 16px 0; }
.channel-facts > div { margin-bottom: 10px; }
.channel-facts dt { color: var(--muted); font-size: 12px; }
.channel-facts dd { margin: 2px 0 0; font-weight: 600; }
.channel-card { min-width: 0; overflow-wrap: anywhere; }
.grid-2:has(> .channel-card) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.grid-2 > .channel-card { margin-bottom: 0; border-radius: 10px; padding: 24px; }
@media (max-width: 900px) { .grid-2:has(> .channel-card) { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .grid-2 > .channel-card { padding: 16px; } }
.channel-card h2 { margin-top: 0; }
.channel-history { padding-left: 20px; overflow-wrap: anywhere; }
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 24px;
}
.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chart {
  height: 205px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  padding-top: 20px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent 48px,
    #edf0f5 49px,
    #edf0f5 50px
  );
}
.bar-group {
  height: 100%;
  flex: 1;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  justify-content: center;
  max-width: 38px;
}
.bar {
  width: 10px;
  border-radius: 4px 4px 0 0;
  background: #6653ad;
}
.bar.blue {
  background: #87a8dc;
}
.bar.h1 {
  height: 22%;
}
.bar.h2 {
  height: 38%;
}
.bar.h3 {
  height: 48%;
}
.bar.h4 {
  height: 57%;
}
.bar.h5 {
  height: 71%;
}
.bar.h6 {
  height: 82%;
}
.chart-labels {
  display: flex;
  justify-content: space-around;
  margin-top: 10px;
  font-size: 10px;
  color: var(--muted);
}
.legend {
  display: flex;
  gap: 18px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #6653ad;
  border-radius: 50%;
  margin-right: 6px;
}
.legend i.blue {
  background: #87a8dc;
}
.activity {
  list-style: none;
  padding: 0;
  margin: 0;
}
.activity li {
  display: flex;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid #edf0f5;
}
.activity li:last-child {
  border-bottom: 0;
}
.activity .event-icon {
  width: 32px;
  height: 32px;
  background: #f3f1fb;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #6653ad;
  flex-shrink: 0;
}
.activity strong {
  display: block;
  font-size: 12px;
}
.activity small {
  font-size: 10px;
}
.activity time {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.mini {
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
}
.mini strong {
  display: block;
  color: var(--purple);
  font-size: 20px;
}
.mini small {
  font-size: 10px;
}
.quick-links {
  display: grid;
  gap: 10px;
}
.quick-link {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.quick-link .icon {
  color: var(--purple);
}
.quick-link span:last-child {
  margin-left: auto;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  color: #2454a4;
  background: #edf3ff;
}
.status.success {
  background: #eaf6ef;
  color: #237447;
}
.status.warning {
  background: #fff6dd;
  color: #855b12;
}
.status.danger {
  background: #ffeded;
  color: #af3434;
}
.status.neutral {
  background: #edf0f5;
  color: #526175;
}
.table-scroll {
  position: relative;
  overflow-x: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
  white-space: nowrap;
}
th {
  background: #f8fafc;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 16px 18px;
  border-bottom: 1px solid #edf0f5;
}
tr:last-child td {
  border-bottom: 0;
}
td strong {
  color: var(--purple);
  font-size: 12px;
}
td small {
  display: block;
  font-size: 10px;
}
th button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
td .btn {
  min-height: 30px;
  padding: 3px 9px;
  font-size: 11px;
}
.table-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-bottom: 1px solid #edf0f5;
  background: #fff;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.filters .field {
  flex: 1 1 130px;
  max-width: 220px;
}
.filters .field.search {
  flex: 2 1 200px;
  max-width: none;
}
label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}
input,
select,
textarea {
  min-height: 46px;
  line-height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 13px;
  background: #fff;
  color: var(--ink);
  width: 100%;
  font-size: 13px;
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #8994a6;
  outline: none;
  box-shadow: none;
}
input::placeholder {
  color: #8994a6;
}
input[readonly],
input:disabled,
select:disabled {
  background: #f3f5fa;
  color: var(--muted);
}
input[type="checkbox"] {
  appearance: none;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  border: 2px solid #64748b;
  border-radius: 4px;
  padding: 0;
}
input[type="checkbox"]:checked { background: var(--blue); border-color: var(--blue); }
input[type="checkbox"]:checked::after { content: ""; display: block; width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: translate(4px, 1px) rotate(45deg); }
input[type="checkbox"]:disabled { opacity: 1; background: #f1f5f9; border-color: #94a3b8; }
input[type="checkbox"]:checked:disabled { background: #94a3b8; }
input[type="checkbox"]:focus-visible { border-color: var(--muted); }
input[aria-invalid="true"] {
  border-color: #b42318;
}
.field-error {
  font-size: 11px;
  color: #b42318;
}
.field-error:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.filters .field > label { color: var(--muted); font-size: 12px; font-weight: 600; }
.filters :is(input,select):focus-visible, .filters :is(input,select):focus { outline: 0; box-shadow: none; border-color: var(--line); }
.sort-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; border-radius: 2px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sort-indicator { position: relative; display: inline-block; flex: 0 0 12px; width: 12px; height: 16px; color: var(--muted); }
.sort-indicator .icon { position: absolute; left: 0; width: 10px; height: 10px; opacity: .5; }
.sort-indicator .icon:first-child { top: 0; transform: rotate(-90deg); }
.sort-indicator .icon:last-child { bottom: 0; transform: rotate(90deg); }
[aria-sort="ascending"] .sort-indicator .icon:last-child, [aria-sort="descending"] .sort-indicator .icon:first-child { display: none; }
[aria-sort="ascending"] .sort-indicator .icon:first-child, [aria-sort="descending"] .sort-indicator .icon:last-child { top: 3px; opacity: 1; color: var(--blue); }
.page-back { margin-bottom: 0; }
.page-head .page-actions { align-self: flex-start; margin-left: auto; width: auto; }
.page-head.internal-page { flex-wrap: nowrap; align-items: flex-start; }
.record-link { font-weight: 600; color: var(--ink); }
.record-link:hover { color: var(--blue); }

/* Consulta: APP V2 / Beneficiario.aspx, Empresas.css, app.css e guardiao-view.css. */
.record-hero { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-color: #d8e0eb; border-radius: 10px; margin-bottom: 20px; }
.record-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; }
.record-identity { display: flex; align-items: center; min-width: 0; gap: 10px; }
.record-hero h2 { color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.client-status-dot { display:inline-block; vertical-align:middle; width:var(--status-dot-size); height:var(--status-dot-size); flex:0 0 var(--status-dot-size); border-radius:50%; background:var(--status-inactive); }
.client-status-dot.active { background:var(--status-active); }
.activity-state { display:inline-flex; align-items:center; gap:var(--status-name-gap); color:var(--ink); }
.record-tabs { display: flex; align-items: flex-end; gap: 0; overflow-x: auto; white-space: nowrap; margin: 0 0 -3px; padding-bottom: 3px; position: relative; scrollbar-width: thin; }
.record-tab { position: relative; z-index: 1; display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 42.25px; padding: 12px 15px; margin: 0 0 -1px; border: 1px solid #d8e0eb; border-radius: 10px 10px 0 0; background: #f4f6f9; color: #64748b; font-size: 13px; font-weight: 500; line-height: 1.2; }
.record-tab + .record-tab { margin-left: -1px; }
.record-tab[aria-selected="true"] { z-index: 2; border-bottom-color: white; background: white; color: #2454a4; font-weight: 600; }
.record-tab[aria-selected="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: white; }
.record-tab:hover { color: #0f172a; }
.record-tab:focus-visible { background: var(--bg); }
.record-content { padding: 20px; border: 1px solid #d8e0eb; border-radius: 0 10px 10px 10px; }
.record-tab-title { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink); margin-bottom: 20px; }
.record-section + .record-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid #d8e0eb; }
.record-section h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--ink); margin-bottom: 16px; }
.record-section h3 > .icon { width: 20px; height: 20px; color: #38a7e8; }
.record-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin: 0; }
.record-fields > div { min-width: 0; padding: 12px 14px; border: 1px solid #d8e0eb; border-radius: 6px; background: #f4f6f9; }
.record-fields dt { font-size: 11px; line-height: 1.4; letter-spacing: .03em; text-transform: uppercase; font-weight: 600; color: #64748b; margin-bottom: 4px; }
.record-fields dd { margin: 0; font-size: 13px; line-height: 1.45; font-weight: 600; overflow-wrap: anywhere; }
.record-hero .record-fields { grid-template-columns: minmax(0,1.05fr) minmax(0,1.8fr) repeat(2,minmax(0,.95fr)); gap: 12px; }
.cnpj-lookup { display: flex; align-items: flex-start; gap: 12px; }
.cnpj-lookup > .field { flex: 0 1 300px; }
.cnpj-lookup > button { margin-top: 33px; }
.client-lookup #lookup-result:not(:empty) { margin-top: 16px; }
.grid-action .section-icon { width: 24px; height: 24px; }
#live-content { position: relative; min-height: 200px; }
.page-loader { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; border: 0; border-radius: 0; width: 100%; height: 100%; background: #fff; cursor: progress; pointer-events: none; }
.page-loader[hidden] { display: none; }
.loader-stage > .btn { position: fixed; top: calc(50% + 40px); left: 50%; transform: translateX(-50%); z-index: 10001; }
.page-loader-spinner { width: 28px; height: 28px; border: 3px solid #d8e0eb; border-top-color: #2454a4; border-radius: 50%; animation: page-spin .7s linear infinite; }
@keyframes page-spin { to { transform: rotate(360deg); } }
.loader-stage { min-height: 250px; }
.loader-stage > .btn { margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .page-loader-spinner { animation: none; border-style: dotted; } }
@media (max-width: 768px) { .record-fields { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 480px) { .record-fields { grid-template-columns: minmax(0,1fr); } .record-content { padding: 16px; } .record-hero { padding: 16px; } .record-hero h2 { font-size: 18px; } .cnpj-lookup { flex-wrap: wrap; } .cnpj-lookup > button { margin-top: 0; } }
.filter-submit { flex: 0 0 46px; width: 46px; height: 46px; min-height: 46px; padding: 0; }
.filter-submit .icon { width: 20px; height: 20px; }
.section-icon { flex-shrink: 0; object-fit: contain; }
.section-heading { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.form-section { min-width: 0; margin: 0 0 20px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.form-section > legend { display: flex; float: left; align-items: center; gap: 10px; width: 100%; margin: 0 0 20px; padding: 0; font-size: 14px; font-weight: 600; line-height: 24px; color: var(--ink); }
.form-section > legend + * { clear: both; }
.form-section .notice:last-child { margin-bottom: 0; }
.form-section .field { gap: 8px; }
.form-section label { line-height: 18px; color: #34405a; }
.form-help { color: var(--muted); font-size: 12px; margin-top: 16px; }
.field-help-group { display:flex; flex-direction:column; gap:4px; min-width:0; }
.field-help-group > .form-help, .field > .form-help { margin:0; line-height:1.4; }
.form-section .form-grid > * { min-width: 0; }
.form-section + .form-actions { margin: 0 0 24px; }
.config-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.config-list > div:last-child { border-bottom: 0; }
.config-list small { display: block; }
.btn.back-button { width: 40px; height: 40px; min-height: 40px; padding: 0; flex: 0 0 40px; border-radius: 6px; }
@media (max-width: 600px) { .form-section { padding: 16px; } }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.full {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  flex-wrap: wrap;
}
.form-actions .btn {
  min-height: 46px;
}
.tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: white;
}
.tab {
  padding: 16px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  background: none;
}
.tab[aria-selected="true"] {
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.detail-grid dt {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.detail-grid dd {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.empty {
  padding: 54px 24px;
  text-align: center;
}
.empty .icon {
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
}
.empty h2 {
  margin-bottom: 8px;
}
.empty p {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 18px;
}
.skeleton {
  height: 18px;
  background: #edf0f5;
  border-radius: 6px;
  margin: 18px 0;
  animation: pulse 1s infinite alternate;
}
.skeleton.large {
  height: 160px;
}
@keyframes pulse {
  to {
    opacity: 0.4;
  }
}
.scenario {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
}
.scenario select {
  font-size: 11px;
  min-height: 32px;
  padding: 4px 8px;
  width: auto;
  max-width: 170px;
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
  background: #fff;
}
.package-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.package {
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.package.highlight {
  border: 2px solid #8571c5;
  padding: 21px 15px;
  background: #fcfbff;
}
.package h2 {
  font-size: 25px;
}
.package .price {
  font-size: 19px;
  font-weight: 600;
  color: var(--purple);
}
.package .btn {
  padding: 8px;
  font-size: 11px;
}
.qr {
  width: 210px;
  height: 210px;
  position: relative;
  background: repeating-conic-gradient(#29235e 0% 25%, #fff 0% 50%) 0 0/28px
    28px;
  border: 12px solid #fff;
  outline: 1px solid var(--line);
  display: grid;
  place-items: center;
  margin: 16px auto;
  overflow: hidden;
}
.qr::before {
  content: "";
  position: absolute;
  inset: 35px;
  background: white;
}
.qr strong {
  background: #fff;
  color: #ad3434;
  font-size: 14px;
  transform: rotate(-25deg);
  border: 2px solid #ad3434;
  padding: 10px;
  z-index: 1;
  white-space: nowrap;
}
.qr-caption {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.timeline {
  border-left: 2px solid #e5e1f7;
  padding-left: 20px;
  margin: 20px 0;
}
.timeline p {
  padding: 9px 0;
  font-size: 12px;
}
.timeline small {
  display: block;
}
.flow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 11px;
  color: var(--muted);
}
.flow span {
  border-radius: 6px;
  background: #f3f1fb;
  padding: 6px 10px;
  color: var(--purple);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  width: min(640px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  color: var(--ink);
  box-shadow: 0 24px 100px #0f172a30;
}
dialog::backdrop {
  background: #18214165;
}
/* Keep scrolling inside the panel, away from its rounded outer border. */
dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
dialog .modal-body {
  padding: 24px 28px;
  overflow-wrap: anywhere;
  min-height: 0;
  overflow-y: auto;
}
dialog .panel-head {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
dialog .close {
  border: 0;
  background: #f3f5fa;
  border-radius: 6px;
  font-size: 21px;
  width: 36px;
  height: 36px;
  color: var(--muted);
}
dialog h2 {
  font-size: 18px;
}
#feedback:not(:empty) {
  position: fixed;
  bottom: 22px;
  right: 22px;
  max-width: min(480px, calc(100% - 40px));
  z-index: 100;
  background: #ecfdf3;
  border: 1px solid #b7e2c9;
  color: #176241;
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 12px;
  box-shadow: 0 8px 30px #152b4a16;
}
/* SPS public access: local geometry/background, Guardiao Bot identity. */
html:has(.auth-page) { overscroll-behavior-y:none; }
.auth-page { position:relative; isolation:isolate; min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; background:#6c73af; }
.auth-photo { position:absolute; inset:0; z-index:-1; background:url("login-background.svg") center / 100% 100% no-repeat; }
.auth-main { flex:1; display:flex; align-items:center; justify-content:center; padding:28px 20px 44px; }
.auth-card { --card-inset:40px; width:440px; max-width:100%; background:#fff; border-radius:20px; padding:38px 40px 24px; box-shadow:0 16px 70px #13212e1a; }
.auth-brand { --brand-gap:20px; position:relative; display:flex; flex-wrap:wrap; align-items:center; gap:var(--brand-gap); margin-bottom:28px; padding-bottom:21px; }
.auth-brand::after,.auth-card-footer::before { content:""; position:absolute; right:calc(var(--card-inset) * -1); left:calc(var(--card-inset) * -1); height:1px; background:var(--line); }
.auth-brand::after { bottom:0; }
.auth-card-footer::before { top:0; }
.auth-brand .brand { margin:0; padding:0; border:0; justify-content:flex-start; font-size:17px; gap:8px; }
.auth-brand .brand-mark { width:34px; height:36px; }
.auth-brand .brand small { font-size:7px; letter-spacing:.9px; }
.auth-portal-title { position:relative; flex:1 1 125px; min-width:0; color:var(--purple); font-size:16px; font-weight:600; line-height:1.25; letter-spacing:-.3px; overflow-wrap:anywhere; }
.auth-portal-title::before { content:""; position:absolute; left:calc(var(--brand-gap) / -2); top:50%; width:1px; height:32px; background:#edf0f5; transform:translateY(-50%); }
.auth-heading { text-align:center; margin-bottom:27px; }
.auth-heading h1 { color:var(--purple); font-size:24px; line-height:1.3; letter-spacing:-.85px; margin:0 0 9px; overflow-wrap:anywhere; }
.auth-heading p { color:var(--muted); font-size:12px; margin:0; }
.auth-card .field { margin:0 0 18px; gap:8px; }
.auth-card .field label { font-size:12px; color:#34405a; line-height:1.6; }
.auth-card .field input { height:46px; padding:11px 13px; line-height:1.6; border-radius:8px; }
.auth-password-wrap { position:relative; }
.auth-password-wrap input { padding-right:76px; }
.auth-eye { position:absolute; inset:1px 1px 1px auto; min-width:68px; padding:0 10px; border:0; border-radius:0 7px 7px 0; color:var(--muted); background:transparent; font-size:11px; }
.auth-eye:hover { color:var(--blue); background:#f8fafc; }
.auth-card .auth-flow-actions { display:flex; flex-direction:column; gap:8px; margin-top:12px; }
.auth-card .auth-flow-actions .btn { width:100%; min-height:46px; padding:11px 20px; margin-top:4px; gap:10px; font-size:13px; line-height:1.5; }
.login-arrow { transform:rotate(180deg); display:inline-flex; margin-left:6px; }
.auth-demo-note { margin:22px 0 0; text-align:center; color:var(--muted); font-size:11px; }
.auth-card-footer { position:relative; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; margin-top:24px; padding-top:21px; font-size:12px; font-weight:600; }
.auth-card-footer .text-button { padding:0; font-size:12px; text-align:left; }
.auth-card-footer a { overflow-wrap:anywhere; }
.auth-footer { display:flex; justify-content:space-between; align-items:center; gap:16px 24px; flex-shrink:0; padding:4px 42px; background:#0f1f32e0; color:#fff; font-size:11px; line-height:1.6; }
.auth-card .notice { margin:0 0 18px; font-size:12px; }
@media (max-width:1024px) { .auth-main { padding-top:18px; padding-bottom:28px; } }
@media (max-width:480px) {
 .auth-main { padding:15px 16px 24px; }
 .auth-card { --card-inset:26px; width:100%; padding:30px 26px 22px; border-radius:17px; }
 .auth-brand { --brand-gap:16px; margin-bottom:25px; }
 .auth-portal-title { font-size:14px; flex-basis:90px; }
 .auth-brand .brand { font-size:15px; }
 .auth-brand .brand small { font-size:6px; letter-spacing:.7px; }
 .auth-heading { margin-bottom:23px; }
 .auth-heading h1 { font-size:22px; letter-spacing:-.8px; }
 .auth-heading p { font-size:11px; }
 .auth-footer { flex-direction:column; gap:4px; padding:4px 16px; text-align:center; }
}
.metric-list {
  display: grid;
  gap: 10px;
}
.metric-line {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #edf0f5;
  padding: 8px 0;
  font-size: 12px;
}
.doc-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
}
.doc-nav {
  display: grid;
  align-content: start;
  gap: 12px;
  font-size: 12px;
  position: sticky;
  top: 24px;
}
.doc-section {
  scroll-margin-top: 20px;
  margin-bottom: 30px;
}
.doc-section h2 {
  margin-bottom: 14px;
}
.doc-section p {
  font-size: 12px;
  margin: 10px 0;
}
.table-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.table-title .avatar {
  width: 30px;
  height: 30px;
  font-size: 10px;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.backdrop {
  display: none;
}
@media (min-width: 1600px) {
  .main {
    padding: 36px 48px;
  }
  .topbar {
    padding-inline: 48px;
  }
}
@media (max-width: 1200px) {
  .sidebar {
    width: 222px;
  }
  .workspace {
    margin-left: 222px;
  }
  .main {
    padding: 24px;
  }
  .topbar {
    padding: 16px 24px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .package-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .scenario-label {
    display: none;
  }
}
/* APP V2: compact icon rail and temporary expansion, preserving the mobile drawer. */
.sidebar-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; }
.sidebar-heading .nav-label { flex:1; min-width:0; margin:0 0 0 12px; }
.sidebar-retract { flex:0 0 44px; width:44px; height:44px; padding:0; color:var(--purple); }
.sidebar-retract .icon { transition:transform 180ms ease; }
body[data-sidebar-retracted="on"] .sidebar-retract .icon { transform:rotate(180deg); }
.nav-link .icon { flex-shrink:0; }
@media (min-width:901px) {
  .sidebar, .workspace { transition:width 180ms ease, margin-left 180ms ease; }
  body[data-sidebar-retracted="on"] .sidebar { width:72px; padding-inline:8px; }
  body[data-sidebar-retracted="on"] .workspace { margin-left:72px; }
  body[data-sidebar-retracted="on"] .sidebar-heading { justify-content:center; }
  body[data-sidebar-retracted="on"] .sidebar:not(:hover):not(:focus-within) :is(.nav-label,.nav-link span,.sidebar-bottom) { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  body[data-sidebar-retracted="on"] .sidebar:not(:hover):not(:focus-within) .nav-link { justify-content:center; padding-inline:10px; }
  body[data-sidebar-retracted="on"] .sidebar:is(:hover,:focus-within) { width:248px; padding-inline:16px; box-shadow:8px 0 24px #152b4a12; }
}
@media (max-width:900px) { .sidebar-retract { display:none; } }
@media (prefers-reduced-motion:reduce) { .sidebar,.workspace,.sidebar-retract .icon { transition:none; } }
#real-login { margin:0; }
#live-content { min-width:0; }
#live-content .form-actions { flex-wrap:wrap; }
#live-content table { width:100%; }
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.18s;
  }
  .sidebar.open {
    transform: none;
    visibility: visible;
    width: 270px;
    max-width: calc(100vw - 40px);
  }
  .workspace {
    margin-left: 0;
  }
  .mobile-toggle,
  .mobile-close {
    display: inline-flex;
  }
  .mobile-close {
    align-self: flex-end;
  }
  .backdrop.open {
    display: block;
    position: fixed;
    inset: var(--shell-header-height) 0 0;
    background: #18214165;
    z-index: 29;
    border: 0;
    width: 100%;
    height: calc(100% - var(--shell-header-height));
  }
  .topbar-left > small {
    display: none;
  }
  .header-context, .header-area-switch { display:none; }
  .mobile-area-switch { display:block; margin:12px 0; padding-left:0; }
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
.doc-grid {
    grid-template-columns: 1fr;
  }
  .doc-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 560px) {
  :root { --shell-header-height:72px; }
  .main {
    padding: 22px 16px;
  }
  .topbar {
    padding: 12px 16px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .topbar-brand { gap:10px; }
  .topbar .brand { font-size:17px; gap:8px; }
  .topbar .brand-mark { width:32px; height:36px; }
  .topbar .brand span small { font-size:8px; letter-spacing:1.3px; }
  .topbar .demo-chip { display:none; }
  .topbar-right {
    gap: 8px;
  }
  .identity {
    display: none;
  }
  .scenario {
    width: 100%;
    justify-content: flex-end;
  }
  .topbar-left {
    gap: 8px;
  }
  .topbar .text-button {
    font-size: 10px;
  }
  .page-head {
    align-items: flex-start;
  }
  .page-head h1 {
    font-size: 22px;
  }
  .kpi-grid {
    gap: 10px;
  }
  .kpi {
    padding: 15px;
  }
  .kpi-top {
    font-size: 10px;
  }
  .kpi-value {
    font-size: 24px;
  }
  .kpi-icon {
    display: none;
  }
  .kpi small {
    font-size: 9px;
  }
  .panel-body {
    padding: 21px 18px;
  }
  .panel-head {
    padding: 18px;
  }
  .filters {
    padding: 18px;
    gap: 10px;
  }
  .filters .field {
    max-width: none;
    flex-basis: calc(50% - 10px);
  }
  .filters .field.search {
    flex-basis: 100%;
  }
  .package-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .package {
    padding: 16px 12px;
  }
  .package.highlight {
    padding: 15px 11px;
  }
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .mini-grid {
    grid-template-columns: 1fr;
  }
  .mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .mini strong {
    font-size: 17px;
  }
  .footer {
    padding: 20px 16px;
  }
  .auth-card {
    padding: 30px 26px 22px;
  }
.tabs {
    gap: 20px;
    padding: 0 18px;
  }
  .notice {
    padding: 12px;
  }
  .panel {
    margin-bottom: 18px;
  }
  .chart {
    gap: 4px;
  }
  .page-actions {
    width: 100%;
  }
  .topbar-right .avatar {
    display: grid;
  }
  .story-stats {
    gap: 20px;
  }
  .qr {
    width: 190px;
    height: 190px;
  }
  dialog .modal-body {
    padding: 20px 18px;
  }
  .activity time {
    font-size: 9px;
  }
  .activity {
    overflow-wrap: anywhere;
  }
  .doc-section pre {
    padding: 14px;
  }
  .table-footer {
    padding: 14px;
  }
  .breadcrumb {
    font-size: 10px;
  }
}
.badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  background: #5b6475;
  color: #fff;
}
.badge.success {
  background: #146c43;
  color: #fff;
}
.badge.warning {
  background: #ffc107;
  color: #212529;
}
.badge.danger {
  background: #b42332;
  color: #fff;
}
.block {
  display: block;
  margin-top: 3px;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
  white-space: nowrap;
}
th {
  background: #f3f5fa;
  color: var(--purple);
  font-size: 13px;
  font-weight: 600;
}
th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
th button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
  display: flex;
  gap: 8px;
}
td .btn + .btn {
  margin-left: 6px;
}
td .btn {
  font-size: 12px;
  min-height: 36px;
  padding: 6px 10px;
}
tbody tr:hover {
  background: #fafbfe;
}
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  font-size: 12px;
}
.table-footer small {
  font-size: 12px;
}
.grid-card { border-radius: 10px; }
.grid-card > .panel-head { padding: 16px 20px; }
.grid-card .filters { margin: 0; padding: 20px; border-bottom: 1px solid var(--line); }
.grid-card .filters .search { flex: 2 1 260px; max-width: none; }
.grid-card > .table-scroll { min-height: 0; border: 0; border-radius: 0; }
.grid-card table { min-width: 640px; font-size: 12px; line-height: 1.5; }
.grid-card th, .grid-card td { padding: 14px 20px; }
.grid-card th { font-size: 13px; }
.grid-card td { vertical-align: middle; }
.grid-card td strong { color: var(--ink); font-size: 12px; }
.grid-card .record-link { font-weight: 600; }
.grid-card .badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; }
.grid-card tbody tr:last-child td { border-bottom: 0; }
.grid-card .table-footer { padding: 16px 20px; }
.grid-card th:last-child, .grid-card td:last-child { text-align: right; }
.grid-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 4px; }
.grid-action { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 36px; flex: 0 0 36px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--blue); }
.grid-action .icon { width: 18px; height: 18px; }
.grid-action:hover { background: #f3f5fa; text-decoration: none; }
.grid-action:focus-visible { background: var(--lilac); }
.pagination { margin-left: auto; flex-wrap: nowrap; font-size: 12px; }
.pagination .btn { min-height: 44px; padding: 10px 16px; border-radius: 6px; font-size: 12px; white-space: nowrap; }
.pagination .icon { width: 16px; height: 16px; }
@media (max-width: 600px) {
 .grid-card .filters { padding: 16px; }
 .grid-card .filters .search { flex-basis: 100%; }
 .grid-card .filters .field { flex-grow: 1; max-width: none; }
 .grid-card .table-footer { padding: 16px; }
 .grid-card th, .grid-card td { padding: 12px; }
 .pagination { flex-wrap: wrap; gap: 8px; margin-left: 0; width: 100%; justify-content: space-between; }
 .pagination .btn { padding-inline: 12px; }
 .pagination > span { flex: 1 0 100%; order: -1; text-align: center; }
}
.footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 32px;
  color: var(--muted);
  font-size: 10px;
}
.scenario {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.scenario label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.scenario select {
  font-size: 10px;
  min-height: 32px;
  padding: 6px 8px;
  max-width: 190px;
}
.overview-toolbar {
  margin-bottom: 20px;
}
.overview-toolbar .section-label {
  margin-right: auto;
}
.overview-toolbar label {
  font-size: 11px;
  color: var(--muted);
}
.overview-toolbar select {
  width: auto;
  min-height: 36px;
  padding: 7px 12px;
  font-size: 11px;
}
.quick-links {
  display: grid;
  gap: 12px;
}
.quick-links .btn {
  justify-content: flex-start;
  min-height: 44px;
}
.detail-heading {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.timeline {
  margin-top: 20px;
}
.timeline > div {
  border-left: 2px solid #e5e1f7;
  padding: 0 0 22px 18px;
  font-size: 12px;
}
.timeline small {
  display: block;
  font-size: 10px;
  margin-top: 5px;
}
.fake-qr {
  width: 210px;
  height: 210px;
  margin: 24px auto;
  position: relative;
  border: 8px solid #f3f1fb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}
.fake-qr-pattern {
  position: absolute;
  inset: 8px;
  background:
    repeating-linear-gradient(37deg, #29235e 0 8px, transparent 8px 16px),
    repeating-linear-gradient(127deg, #29235e 0 5px, transparent 5px 19px);
  opacity: 0.16;
}
.fake-qr strong {
  z-index: 1;
  font-size: 17px;
  color: #a82929;
  transform: rotate(-12deg);
  background: #fff;
  padding: 12px 4px;
  border-block: 2px solid #a82929;
}
.fake-qr small {
  z-index: 1;
  font-size: 10px;
  background: white;
  margin-top: 8px;
  padding: 4px;
}
.package-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.package-card h2 {
  font-size: 25px;
}
.package-card h2 small {
  font-size: 12px;
  display: block;
  margin-top: 4px;
}
.package-price {
  font-size: 27px;
  color: var(--purple);
}
.package-card p {
  color: var(--muted);
  font-size: 11px;
}
.package-card .btn {
  margin-top: auto;
  width: 100%;
}
.skeletons {
  display: grid;
  gap: 20px;
  padding: 30px 0;
}
.density-compact td {
  padding-block: 9px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.icon {
  fill: currentColor;
}
.main:focus {
  outline: none;
}
.detail-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.package-card {
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.package-card h2 {
  font-size: 25px;
}
.package-price {
  font-size: 22px;
  color: var(--purple);
}
.package-card p {
  font-size: 12px;
  color: var(--muted);
}
.timeline > div {
  padding: 10px 0;
  font-size: 12px;
}
.fake-qr small {
  position: relative;
  background: #fff;
  padding: 2px 6px;
  margin-top: 14px;
  font-size: 9px;
}
.skip {
  top: 12px;
  transform: translateY(calc(-100% - 24px));
}
.skip:focus {
  transform: none;
}

@media (max-width: 560px) {
  .overview-toolbar .section-label {
    flex-basis: 100%;
    margin-right: 0;
  }
  .main:focus {
    outline: none;
  }
}

.main:focus { outline: none; }
.entry-hub { min-height: 100dvh; }
.entry-hub .auth-card > .brand { justify-content:center; margin-bottom:28px; }
.entry-hub h2 { text-align:center; font-size:24px; margin-bottom:10px; }
.entry-hub .auth-card > p { text-align:center; font-size:12px; color:var(--muted); margin-bottom:24px; }
.entry-hub .btn { width:100%; margin-top:12px; }

/* APP V2 header: preserve identity, avatar and account actions on compact screens. */
@media (max-width: 900px) {
  .topbar .header-context { display: flex; }
}
@media (max-width: 768px) {
  :root { --shell-header-height: 72px; }
  .topbar { padding-inline: 20px; }
  .header-context strong { font-size: 12px; }
  .header-symbol { width: 44px; height: 44px; }
}
@media (max-width: 480px) {
  :root { --shell-header-height: 66px; }
  .topbar { padding-inline: 18px; }
  .header-symbol { width: 40px; height: 40px; }
  .header-symbol .icon { width: 30px; height: 30px; }
  .topbar-right { gap: 8px; }
  .topbar .avatar { display: grid; width: 32px; height: 32px; }
  .account-chevron { display: none; }
  .header-context small { max-width: 120px; }
}
@media (max-width: 375px) {
  .topbar { padding-inline: 12px; gap: 8px; }
  .topbar-brand { gap: 8px; }
  .topbar .header-context { display: none; }
}

@media (max-width: 991.98px) { .record-hero-top { align-items: flex-start; flex-direction: column; } .record-hero .record-fields { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 767.98px) { .record-section + .record-section { margin-top: 20px; padding-top: 20px; } }

/* Modal compacto do SPS, usando o dialog e o helper locais. */
dialog.client-edit-dialog { width: calc(100% - 32px); max-width: 460px; padding: 28px; border-radius: 18px; box-shadow: 0 20px 80px #0f172a30; }
dialog.client-edit-dialog::backdrop { background: #15193266; backdrop-filter: blur(3px); }
.client-edit-dialog .panel-head { padding: 0; margin-bottom: 14px; border: 0; position: static; }
.client-edit-dialog .panel-head h2 { font-size: 22px; }
.client-edit-dialog .modal-body { padding: 0; }
.client-edit-dialog .form-section { padding: 0; margin: 0; border: 0; background: transparent; }
.client-edit-dialog .form-section > legend { display: none; }
.client-edit-dialog .form-grid { grid-template-columns: minmax(0,1fr); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.client-edit-dialog .modal-actions .btn { min-height: 44px; }

.record-section-icon { display: inline-block; flex: 0 0 20px; width: 20px; height: 20px; background: #38a7e8; mask: var(--record-symbol) center/contain no-repeat; -webkit-mask: var(--record-symbol) center/contain no-repeat; }
.record-section-icon-people { --record-symbol: url('icons/appv2-bootstrap-1.13.2/person-vcard-fill.svg'); }
.record-section-icon-chat { --record-symbol: url('icons/appv2-bootstrap-1.13.2/chat-dots-fill.svg'); }
.record-section-icon-home { --record-symbol: url('icons/appv2-bootstrap-1.13.2/geo-alt-fill.svg'); }
.record-section-icon-key { --record-symbol: url('icons/appv2-bootstrap-1.13.2/key-fill.svg'); }

.client-name { display: inline-flex; align-items: center; gap:var(--status-name-gap); }

/* Combo nativo da skin SPS, compartilhado por filtros, formularios e modais. */
select:not([multiple]):not([size]):not(.flatpickr-monthDropdown-months),
select[size="1"]:not([multiple]) {
 appearance: none;
 padding-right: 44px;
 background-image: url("icons/fluent-regular-1.1.343/chevron-down.svg");
 background-position: right 10px center;
 background-size: 24px 24px;
 background-repeat: no-repeat;
}

dialog.client-create-dialog { width: calc(100% - 32px); max-width: 460px; padding: 28px; border-radius: 18px; box-shadow: 0 20px 80px #0f172a30; }
dialog.client-create-dialog.has-company { max-width: 680px; }
dialog.client-create-dialog::backdrop { background: #15193266; backdrop-filter: blur(3px); }
.client-create-dialog .panel-head { padding: 0; margin-bottom: 20px; border: 0; position: static; }
.client-create-dialog .panel-head h2 { font-size: 22px; }
.client-create-dialog .modal-body { padding: 0; }
.client-create-dialog .form-section { padding: 0; margin: 20px 0 0; border: 0; background: transparent; }
.client-create-dialog .form-section > legend { margin-bottom: 16px; }
.cnpj-search-wrap { position: relative; }
.cnpj-search-wrap input { padding-right: 54px; }
.cnpj-search { position: absolute; top: 50%; right: 1px; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--blue); }
.cnpj-search .icon { width: 20px; height: 20px; }
.cnpj-search:hover, .cnpj-search:focus-visible { background: #f3f5fa; }
.cnpj-search[aria-busy="true"] { opacity: .6; }
.client-registration-summary { margin-top: 20px; padding: 14px; border-radius: 6px; background: #f4f6f9; }
.client-registration-summary > summary { cursor: pointer; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.client-registration-summary[open] > summary { margin-bottom: 20px; }
.client-registration-summary .record-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
.client-registration-summary .record-section + .record-section { margin-top: 20px; padding-top: 20px; }
.client-create-dialog .modal-actions .btn { min-height: 44px; }
@media (max-width: 600px) {
 dialog.client-create-dialog { padding: 20px; }
 .client-create-dialog .form-grid, .client-registration-summary .record-fields { grid-template-columns: minmax(0,1fr); }
}
.instance-connection-visual { display:flex; flex-direction:column; align-items:center; gap:4px; margin:20px auto 0; }
.instance-connection-visual .form-help { margin:0; max-width:280px; text-align:center; font-size:12px; line-height:1.4; }
.instance-qr, .instance-waiting { display:block; width:280px; max-width:100%; aspect-ratio:1; height:auto; object-fit:contain; margin:0 auto; }
.instance-waiting { animation:instance-waiting-pulse 1.5s ease-in-out infinite; }
@keyframes instance-waiting-pulse { 0%,100% { opacity:.55; transform:scale(.96); } 50% { opacity:1; transform:scale(1); } }
@media(prefers-reduced-motion:reduce) { .instance-waiting { animation:none; } }
/* Select2 dos clientes: mesmas dimensoes e tokens dos combos SPS. */
body .select2-container .select2-selection--single { height:46px; border:1px solid var(--line); border-radius:6px; background:#fff; font:inherit; }
body .select2-container--default .select2-selection--single .select2-selection__rendered { line-height:44px; padding-left:14px; padding-right:44px; color:var(--ink); font-size:13px; }
body .select2-container--default .select2-selection--single .select2-selection__arrow { height:44px; width:44px; top:0; right:0; background:url('icons/fluent-regular-1.1.343/chevron-down.svg') center/24px no-repeat; }
body .select2-container--default .select2-selection--single .select2-selection__arrow b { display:none; }
body .select2-container--default.select2-container--focus .select2-selection--single,
body .select2-container--default.select2-container--open .select2-selection--single { border-color:#8592a7; outline:none; box-shadow:none; }
body .select2-dropdown { border:1px solid var(--line); border-radius:6px; box-shadow:0 8px 20px #152b4a12; font-size:13px; }
body .select2-container--default .select2-search--dropdown .select2-search__field { height:40px; border:1px solid var(--line); border-radius:6px; font:inherit; outline:none; box-shadow:none; }
body .select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color:#8592a7; }
body .select2-container .select2-selection:focus-visible { outline:none; box-shadow:none; border-color:#8592a7; }
.instance-dialog .check { display:flex; align-items:flex-start; gap:10px; margin-top:16px; font-size:13px; font-weight:400; }
.instance-dialog .check input[type=checkbox] { flex:0 0 18px; width:18px; height:18px; margin:1px 0 0; }
body .select2-results__option { padding:10px 14px; }
body .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background:var(--blue); color:#fff; }
/* Instancias reutilizam a estrutura de formulario modal da skin SPS. */
.instance-record { display:grid; grid-template-columns:var(--status-dot-size) minmax(0,1fr); column-gap:var(--status-name-gap); align-items:start; }
.instance-record > .client-status-dot { margin-top:3px; }
.instance-record-text { min-width:0; }
.instance-record-text > .record-link { display:block; padding:0; min-height:20px; line-height:20px; text-align:left; }
.instance-code { overflow-wrap:anywhere; }
.integration-channel-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:stretch; }
.integration-channel-card { display:grid; grid-template-columns:48px minmax(0,1fr) auto; align-items:center; gap:16px; padding:20px; border:1px solid var(--line); border-radius:var(--radius); background:white; box-shadow:0 3px 10px #0f172a06; }
.integration-channel-logo { width:48px; height:48px; display:flex; align-items:center; justify-content:center; }
.integration-channel-body { display:flex; flex-direction:column; justify-content:center; min-width:0; gap:8px; }
.integration-channel-body h3 { margin:0; font-size:17px; line-height:1.3; font-weight:600; color:var(--ink); }
.integration-channel-body p { margin:0; font-size:12px; color:var(--muted); }
.integration-channel-footer { display:flex; align-items:center; justify-content:flex-end; }
.channel-switch { position:relative; display:inline-flex; align-items:center; gap:10px; cursor:pointer; font-size:13px; color:var(--ink); }
.channel-switch input[type=checkbox] { position:absolute; width:1px; height:1px; padding:0; opacity:0; }
.channel-switch-track { display:inline-block; position:relative; flex:0 0 42px; width:42px; height:24px; border-radius:20px; border:1px solid var(--status-inactive); background:var(--status-inactive); transition:background .15s; }
.channel-switch-track::after { content:''; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:white; box-shadow:0 1px 3px #0f172a26; transition:transform .15s; }
.channel-switch input:checked + .channel-switch-track { background:var(--status-active); border-color:var(--status-active); }
.channel-switch input:checked + .channel-switch-track::after { transform:translateX(18px); }
.channel-switch input:focus-visible + .channel-switch-track { outline:2px solid var(--muted); outline-offset:3px; }
.channel-switch input:disabled ~ span { opacity:.55; cursor:default; }
.client-channel-badges { display:flex; flex-wrap:wrap; gap:6px; }
.client-channel-badges .badge { white-space:nowrap; }
@media(max-width:700px) { .integration-channel-grid { grid-template-columns:minmax(0,1fr); } }
.instance-status-action.inactivate { color:#b42318; }
.instance-status-action.activate { color:#146c43; }
.instance-status-action .icon { width:20px; height:20px; fill:currentColor; }
dialog.instance-dialog { width:calc(100% - 32px); max-width:680px; padding:28px; border-radius:18px; box-shadow:0 20px 80px #0f172a30; }
dialog.instance-dialog::backdrop { background:#15193266; backdrop-filter:blur(3px); }
.instance-dialog .panel-head { padding:0; margin-bottom:20px; border:0; position:static; }
.instance-dialog .panel-head h2 { font-size:22px; }
.instance-dialog .panel-head h2 { display:flex; align-items:center; gap:10px; }
.instance-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:0; }
.instance-summary.client-instance-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
.instance-summary > div { min-width:0; }
.instance-summary-wide { grid-column:1 / -1; }
.instance-summary dt { margin-bottom:6px; color:var(--muted); font-size:12px; }
.instance-summary dd { margin:0; font-size:14px; font-weight:500; overflow-wrap:anywhere; }
.instance-summary code { font-family:inherit; font-size:13px; color:var(--ink); }
.instance-connection { margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.instance-session-actions { display:flex; align-items:center; justify-content:space-between; flex-wrap:nowrap; gap:14px; overflow-x:auto; padding:3px 0; }
.instance-action { display:inline-flex; align-items:center; justify-content:flex-start; flex:0 0 auto; gap:6px; min-height:32px; padding:0; border:0; border-radius:0; background:transparent; color:var(--blue); font:inherit; font-size:12px; font-weight:500; white-space:nowrap; cursor:pointer; box-shadow:none; }
.instance-action.danger { color:#b42318; }
.instance-action.success { color:var(--status-active); }
.instance-action.warning { color:#b45309; }
.instance-action.qr-action { color:#111111; }
.instance-action:hover span { text-decoration:underline; }
.instance-action:focus-visible { outline:2px solid var(--muted); outline-offset:3px; }
.instance-action:disabled { color:#94a3b8; cursor:default; }
.instance-action:disabled span { text-decoration:none; }
.instance-session-actions .icon { width:18px; height:18px; flex-shrink:0; }
.instance-detail-footer { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-top:24px; padding-top:20px; border-top:1px solid var(--line); flex-shrink:0; }
.instance-detail-footer .icon { width:18px; height:18px; }
.meta-onboarding-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }
.meta-onboarding form { border-top:1px solid var(--line); margin-top:20px; padding-top:20px; }
.meta-onboarding .notice { margin-top:16px; }
@media(max-width:480px) { .instance-summary, .instance-summary.client-instance-summary { grid-template-columns:minmax(0,1fr); gap:12px; } }
.instance-dialog .modal-body { padding:0 12px 0 0; }
.instance-dialog .form-section { padding:0; margin:20px 0 0; border:0; background:transparent; }
.instance-dialog .form-section > legend { margin-bottom:16px; }
@media(max-width:600px) { dialog.instance-dialog { padding:20px; } .instance-dialog .form-grid { grid-template-columns:minmax(0,1fr); } }
