:root {
  --brand-navy: #0d2845;
  --brand-navy-dark: #0a1f36;
  --brand-cyan: #7dd8f5;
  --brand-cyan-soft: #e6f6fc;
  --surface: #ffffff;
  --surface-muted: #eef1f5;
  --line: rgba(13, 40, 69, 0.08);
  --line-strong: rgba(13, 40, 69, 0.16);
  --text: #0d2845;
  --muted: #7188a0;
  --success: #1e9e60;
  --success-soft: #e6f5ed;
  --danger: #d83a3a;
  --danger-soft: #fbe9e9;
  --warning: #e88a1c;
  --warning-soft: #fdf1e1;
  --teal: #0fa3a3;
  --teal-soft: #e1f3f3;
  --purple: #7c4ed1;
  --purple-soft: #efe6fa;
  --yellow: #f4c145;
  --yellow-soft: #fdf3d4;
  --shadow: 0 20px 60px rgba(13, 40, 69, 0.10);
  --radius: 8px;
  --page-pad: 24px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --brand-cyan-soft: rgba(125, 216, 245, 0.14);
  --surface: #102033;
  --surface-muted: #091421;
  --line: rgba(201, 220, 238, 0.12);
  --line-strong: rgba(201, 220, 238, 0.22);
  --text: #eaf3fb;
  --muted: #9db3c7;
  --success-soft: rgba(30, 158, 96, 0.18);
  --danger-soft: rgba(216, 58, 58, 0.18);
  --warning-soft: rgba(232, 138, 28, 0.18);
  --teal-soft: rgba(15, 163, 163, 0.18);
  --purple-soft: rgba(124, 78, 209, 0.2);
  --yellow-soft: rgba(244, 193, 69, 0.18);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  width: 100%;
  min-height: 100%;
  max-width: 100%;
  scrollbar-gutter: stable;
  overflow-x: hidden;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: #eef4f8;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
}

.theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .theme-icon,
.theme-toggle-floating .theme-icon {
  display: none !important;
}

html:not([data-theme="dark"]) .theme-toggle .theme-icon-moon,
html:not([data-theme="dark"]) .theme-toggle-floating .theme-icon-moon {
  display: block !important;
}

html[data-theme="dark"] .theme-toggle .theme-icon-sun,
html[data-theme="dark"] .theme-toggle-floating .theme-icon-sun {
  display: block !important;
}

.theme-toggle-floating {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 80;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(13, 40, 69, 0.14);
  border-radius: 12px;
  color: var(--brand-navy);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(13, 40, 69, 0.12);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.theme-toggle-floating:hover {
  background: #ffffff;
  border-color: rgba(13, 40, 69, 0.24);
}

a {
  color: inherit;
}

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

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px var(--page-pad) 72px;
  background:
    linear-gradient(90deg, rgba(245, 248, 251, 0.94), rgba(245, 248, 251, 0.78)),
    url("../assets/img/bklogin.jpg") center / cover no-repeat;
}

.auth-shell {
  width: min(1120px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  background: var(--surface);
  border: 1px solid rgba(216, 226, 234, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 44px;
}

.auth-logo {
  width: min(260px, 80%);
  height: auto;
  align-self: center;
}

.auth-heading {
  text-align: center;
}

.auth-heading h1,
.section-heading h1,
.section-heading h2,
.credentials-header h1 {
  margin: 0;
  color: var(--brand-navy-dark);
}

.auth-heading h1 {
  font-size: 30px;
}

.auth-heading p,
.brand-panel-content p,
.empty-state span,
.credential-provider span,
.session-title span {
  color: var(--muted);
  line-height: 1.55;
}

.brand-panel {
  display: flex;
  align-items: flex-end;
  min-height: 100%;
  padding: 56px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(12, 53, 86, 0.96), rgba(22, 74, 115, 0.9)),
    url("../assets/img/bg-light-pattern.png") center / cover no-repeat;
}

.brand-panel-content {
  max-width: 580px;
}

.brand-panel-content h2 {
  margin: 10px 0 14px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.brand-panel-content p {
  max-width: 460px;
  color: rgba(255, 255, 255, 0.92);
}

.eyebrow {
  display: inline-block;
  color: var(--brand-cyan);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-panel .eyebrow {
  color: #9eeaf3;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.label-text {
  color: var(--brand-navy-dark);
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #9eb2c3;
  border-radius: var(--radius);
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.field input:focus,
.field select:focus,
.file-drop:focus-within {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(98, 200, 216, 0.24);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.button-primary {
  color: #ffffff;
  background: var(--brand-navy);
  box-shadow: 0 10px 24px rgba(22, 74, 115, 0.22);
}

.button-primary:hover:not(:disabled) {
  background: var(--brand-navy-dark);
}

.button-secondary {
  color: var(--brand-navy-dark);
  background: #d8f1f5;
  border: 1px solid #6aaebb;
}

.button-ghost {
  color: var(--brand-navy-dark);
  background: transparent;
  border: 1px solid #92a8ba;
}

.button-danger {
  color: #ffffff;
  background: var(--danger);
}

.button-small {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}

.text-link {
  color: var(--brand-navy);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.inline-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.inline-status.is-empty {
  display: none;
}

.inline-status.is-neutral {
  color: var(--brand-navy-dark);
  background: var(--brand-cyan-soft);
}

.inline-status.is-error {
  color: var(--danger);
  background: var(--danger-soft);
}

.inline-status.is-success {
  color: var(--success);
  background: var(--success-soft);
}

.upload-limit-note {
  margin-top: 0;
  display: grid;
  gap: 4px;
}

.upload-limit-note span {
  font-weight: 600;
}

.page-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 6px 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid rgba(216, 226, 234, 0.88);
  font-size: 12px;
}

.page-footer img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.auth-page .page-footer {
  width: 100%;
}

.app-page {
  width: 100%;
  background: var(--surface-muted);
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar-brand img {
  width: 150px;
  max-width: 42vw;
  height: auto;
  display: block;
}

.topbar-actions,
.form-actions-row,
.dialog-actions,
.session-actions {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-layout {
  width: min(1280px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  margin: 28px auto 48px;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(340px, 1.08fr);
  gap: 24px;
  align-items: start;
}

.app-layout > *,
.consultation-surface,
.history-surface,
.history-list,
.session-card,
.session-title {
  min-width: 0;
}

.consultation-surface,
.history-surface,
.credentials-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(13, 53, 86, 0.08);
}

.consultation-surface,
.history-surface {
  padding: clamp(20px, 3vw, 30px);
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.section-heading h1 {
  font-size: clamp(28px, 4vw, 38px);
}

.section-heading h2 {
  font-size: 22px;
}

.section-heading.compact {
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 16px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  margin-bottom: 22px;
  background: #e8eff5;
  border-radius: var(--radius);
}

.segmented-button {
  min-height: 44px;
  border-radius: calc(var(--radius) - 2px);
  color: var(--brand-navy-dark);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.segmented-button.is-active {
  color: #ffffff;
  background: var(--brand-navy);
  box-shadow: 0 8px 18px rgba(22, 74, 115, 0.2);
}

.file-drop {
  max-width: 100%;
  display: grid;
  gap: 8px;
  min-height: 142px;
  align-content: center;
  padding: 22px;
  border: 2px dashed #617f96;
  border-radius: var(--radius);
  color: var(--brand-navy-dark);
  background: #f7fbfd;
  cursor: pointer;
}

.file-drop strong {
  font-size: 17px;
}

.file-drop span,
.file-drop small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.file-drop small {
  color: var(--brand-navy-dark);
  font-weight: 800;
}

.file-drop.has-file {
  border-color: var(--brand-cyan);
  background: var(--brand-cyan-soft);
}

.file-drop.is-dragging {
  border-color: var(--brand-navy);
  background: #d8f1f5;
  box-shadow: inset 0 0 0 2px rgba(15, 70, 110, 0.18);
}

.align-end {
  justify-content: flex-end;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-weight: 800;
}

.notice.is-success {
  color: var(--success);
  background: var(--success-soft);
}

.history-list,
.credentials-list {
  display: grid;
  gap: 14px;
}

.session-card,
.credential-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.session-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.session-card-header,
.session-footer,
.credential-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.session-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.session-title img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface-muted);
}

.session-title strong,
.session-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.status-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--brand-navy-dark);
  background: #e8eff5;
  font-size: 12px;
  font-weight: 900;
}

.status-finalizado {
  color: var(--success);
  background: var(--success-soft);
}

.status-em-andamento,
.status-finalizando {
  color: var(--brand-navy-dark);
  background: var(--brand-cyan-soft);
}

.status-cancelado,
.status-em-pausa {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-falha,
.status-failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf3;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-navy), var(--brand-cyan));
  transition: width 240ms ease;
}

.progress-percent {
  color: var(--brand-navy-dark);
  font-weight: 900;
}

.empty-state,
.loading-state {
  display: grid;
  gap: 6px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.empty-state strong {
  color: var(--brand-navy-dark);
}

.empty-state.is-error strong {
  color: var(--danger);
}

.modal-dialog {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  overflow: hidden;
}

.modal-dialog::backdrop {
  background: rgba(6, 22, 35, 0.72);
}

.dialog-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dialog-header h2 {
  margin: 0;
  color: var(--brand-navy-dark);
}

.dialog-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.dialog-actions {
  justify-content: flex-end;
}

.announcement-dialog {
  width: min(560px, calc(100% - 32px));
}

.announcement-panel {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.announcement-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 24px;
  color: #ffffff;
  background: #164a73;
}

.announcement-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #164a73;
  background: #dff3fb;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.announcement-close {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.announcement-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.announcement-copy {
  display: grid;
  gap: 10px;
  padding: 24px 24px 22px;
}

.announcement-copy h2 {
  margin: 0;
  color: var(--brand-navy-dark);
  font-size: 22px;
}

.announcement-copy p {
  color: #4f657b;
  font-size: 14px;
  white-space: pre-line;
}

.announcement-preference {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin: 0 24px 22px;
  color: #52697f;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.announcement-preference input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-navy);
}

.announcement-actions {
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.announcement-actions .button {
  min-width: 110px;
}

.announcement-actions:not(.has-cta) .button-primary {
  min-width: 132px;
}

.announcement-dialog.is-novidade .announcement-header {
  background: var(--brand-navy);
}

.announcement-dialog.is-novidade .announcement-badge {
  color: var(--brand-navy-dark);
  background: var(--brand-cyan);
}

.announcement-dialog.is-manutencao .announcement-header {
  background: #9c5b10;
}

.announcement-dialog.is-manutencao .announcement-badge {
  color: #8a4d08;
  background: #fff1db;
}

.announcement-dialog.is-alerta .announcement-header {
  background: #a83232;
}

.announcement-dialog.is-alerta .announcement-badge {
  color: #932222;
  background: #fde7e7;
}

.announcement-dialog.is-informacao .announcement-header {
  background: #16616d;
}

.announcement-dialog.is-informacao .announcement-badge {
  color: #14545f;
  background: #def6f7;
}

.announcement-dialog.is-blocking {
  width: min(620px, calc(100% - 32px));
}

.announcement-dialog.is-blocking .announcement-copy {
  padding-bottom: 28px;
}

.announcement-dialog.is-blocking::backdrop {
  background: rgba(5, 16, 29, 0.78);
  backdrop-filter: blur(3px);
}

.iframe-dialog {
  width: min(1160px, calc(100% - 28px));
  max-width: none;
}

.iframe-shell {
  position: relative;
  width: 100%;
  height: min(860px, 92vh);
  height: min(860px, calc(100dvh - 28px));
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  overflow: hidden;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.iframe-shell iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(146, 168, 186, 0.72);
  border-radius: 999px;
  color: var(--brand-navy-dark);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(13, 53, 86, 0.16);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.dialog-close:hover {
  color: #ffffff;
  background: var(--brand-navy);
  box-shadow: 0 14px 28px rgba(13, 53, 86, 0.24);
  transform: translateY(-1px);
}

.dialog-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(98, 200, 216, 0.28), 0 14px 28px rgba(13, 53, 86, 0.18);
}

.dialog-close-icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.dialog-close-icon::before,
.dialog-close-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 1px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.dialog-close-icon::before {
  transform: translateY(-50%) rotate(45deg);
}

.dialog-close-icon::after {
  transform: translateY(-50%) rotate(-45deg);
}

.dialog-close-text {
  line-height: 1;
}

.credentials-page {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  background: #ffffff;
  overflow-x: hidden;
}

.credentials-layout {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 20px;
  padding: 24px;
  background: var(--surface-muted);
  overflow-x: hidden;
}

.credentials-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.credentials-header img {
  width: 136px;
  max-width: 36vw;
}

.credentials-surface {
  max-width: 100%;
  padding: 20px;
  overflow: hidden;
}

.credential-card {
  padding: 16px;
  min-width: 0;
  max-width: 100%;
}

.credential-provider {
  flex: 0 1 180px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.client-id-toggle {
  flex: 1 1 360px;
  min-width: 0;
  max-width: min(520px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #8ca4b8;
  border-radius: var(--radius);
  color: var(--brand-navy-dark);
  background: #f7fbfd;
  cursor: pointer;
  text-align: left;
}

.client-id-toggle:hover,
.client-id-toggle:focus-visible {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(98, 200, 216, 0.2);
  outline: none;
}

.client-id-label,
.client-id-action {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.client-id-label {
  color: var(--muted);
}

.client-id-value {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-id-toggle[aria-expanded="true"] .client-id-value {
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.client-id-action {
  color: var(--brand-cyan);
}

.toast-region {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100% - 36px));
}

.toast {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(13, 40, 69, 0.16);
  animation: toastIn 180ms ease both;
}

.toast-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
}

.toast-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding-top: 1px;
}

.toast-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.toast-copy span {
  color: #52697f;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.toast-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #6a8095;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.toast-close:hover {
  color: var(--text);
  background: #eef3f7;
}

.toast.is-success {
  border-color: rgba(30, 158, 96, 0.24);
}

.toast.is-success .toast-icon {
  color: var(--success);
  background: var(--success-soft);
}

.toast.is-error {
  border-color: rgba(216, 58, 58, 0.24);
}

.toast.is-error .toast-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.toast.is-warning {
  border-color: rgba(232, 138, 28, 0.26);
}

.toast.is-warning .toast-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.toast.is-info {
  border-color: rgba(15, 163, 163, 0.24);
}

.toast.is-info .toast-icon {
  color: var(--teal);
  background: var(--teal-soft);
}

.toast.is-leaving {
  animation: toastOut 200ms ease both;
}

.environment-badge {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 90;
  padding: 8px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: #f59f00;
  box-shadow: 0 10px 24px rgba(183, 121, 31, 0.24);
  font-size: 12px;
  font-weight: 900;
}

html.modal-open,
body.modal-open {
  overflow: hidden;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (max-width: 920px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 260px;
    align-items: center;
    padding: 34px;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --page-pad: 14px;
  }

  .auth-page {
    align-items: flex-start;
    padding: 12px 10px 24px;
    background: #e9f0f5;
  }

  .auth-shell {
    min-height: auto;
    border-radius: var(--radius);
  }

  .auth-heading h1 {
    font-size: 26px;
  }

  .auth-panel {
    gap: 16px;
    padding: 22px 16px;
  }

  .auth-logo {
    width: min(190px, 82%);
  }

  .brand-panel {
    min-height: 190px;
    padding: 24px 18px;
  }

  .brand-panel-content h2 {
    font-size: 25px;
    line-height: 1.12;
  }

  .brand-panel-content p {
    margin-bottom: 0;
  }

  .field input,
  .field select {
    min-height: 48px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .topbar-actions .button,
  .form-actions-row .button,
  .dialog-actions .button {
    width: 100%;
  }

  .app-layout {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    margin-top: 14px;
  }

  .section-heading.compact,
  .session-card-header,
  .session-footer,
  .credential-card {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading.compact {
    display: flex;
  }

  .session-actions,
  .session-actions .button {
    width: 100%;
  }

  .credentials-layout {
    padding: 12px;
  }

  .credentials-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .credential-card .button,
  .credential-card .client-id-toggle {
    width: 100%;
  }

  .dialog-close {
    top: 10px;
    right: 10px;
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .dialog-close-text {
    display: none;
  }

  .page-footer {
    position: static;
    width: 100%;
    margin-top: 12px;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 4px;
    text-align: center;
  }
}

/* Claude prototype parity refinements */
.sidebar {
  width: 240px;
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.is-collapsed {
  width: 70px;
}

.el-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.el-logo-chip {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  padding: 3px;
  border-radius: 9px;
  background: var(--brand-navy);
  box-shadow: 0 1px 2px rgba(13, 40, 69, 0.12);
}

.el-logo-chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.el-logo-wordmark {
  display: grid;
  gap: 0;
  line-height: 0.95;
}

.el-logo-wordmark strong {
  font-size: 17.5px;
  font-weight: 800;
}

.el-logo-wordmark strong:first-child {
  color: var(--brand-navy);
}

.el-logo-wordmark strong:last-child {
  color: var(--brand-cyan);
}

.sidebar.is-collapsed .sidebar-brand {
  justify-content: center;
  padding: 18px 0;
}

.sidebar.is-collapsed .el-logo-wordmark,
.sidebar.is-collapsed .nav-label,
.sidebar.is-collapsed .soon-badge,
.sidebar.is-collapsed .sidebar-live,
.sidebar.is-collapsed .sidebar-user-info,
.sidebar.is-collapsed #logoutButton {
  display: none;
}

.sidebar.is-collapsed .el-logo-chip {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

.sidebar.is-collapsed .nav-item {
  justify-content: center;
  padding: 11px 0;
}

.sidebar.is-collapsed .nav-item.is-active::before {
  display: none;
}

.sidebar.is-collapsed .nav-badge {
  position: absolute;
  top: 5px;
  right: 8px;
  margin-left: 0;
}

.sidebar.is-collapsed .sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar.is-collapsed .sidebar-actions {
  width: 100%;
}

.sidebar.is-collapsed .sidebar-actions #sidebarToggle {
  width: 100%;
}

.nav-icon {
  background: transparent;
}

.nav-icon svg,
.icon-button svg,
.button svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar.is-collapsed .nav-icon svg {
  width: 20px;
  height: 20px;
}

.nav-item.is-disabled,
.nav-item.is-disabled:hover {
  cursor: not-allowed;
  opacity: 0.55;
  background: transparent;
}

.sidebar-actions {
  display: flex;
  gap: 6px;
}

.sidebar-actions .icon-button {
  height: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 600;
}

.sidebar-actions #sidebarToggle {
  flex: 0 0 36px;
  padding: 0;
  color: var(--muted);
  background: #f7f9fc;
}

.sidebar-actions #logoutButton {
  flex: 1;
  color: var(--danger);
  border-color: rgba(216, 58, 58, 0.25);
}

.icon-expand {
  display: none !important;
}

.sidebar.is-collapsed .icon-collapse {
  display: none !important;
}

.sidebar.is-collapsed .icon-expand {
  display: block !important;
}

.content-topbar,
.view-content {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.kpi-card {
  min-height: 120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-content: start;
  gap: 6px 12px;
}

.kpi-card::after {
  content: "";
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 8px;
  background: rgba(13, 40, 69, 0.08);
}

.kpi-card.accent-green::after {
  background: rgba(30, 158, 96, 0.10);
}

.kpi-card.accent-teal::after {
  background: rgba(15, 163, 163, 0.10);
}

.kpi-card.accent-orange::after {
  background: rgba(232, 138, 28, 0.10);
}

.kpi-card > span,
.kpi-card > strong,
.kpi-card > small {
  grid-column: 1;
}

.card-panel,
.kpi-card {
  border-radius: 12px;
}

.navy-panel {
  border-radius: 14px;
}

.v2-session {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.v2-session:hover {
  border-color: var(--line-strong);
}

.product-mark {
  flex: 0 0 44px;
}

.session-card-header {
  align-items: flex-start;
}

.session-title strong {
  font-size: 15px;
  font-weight: 700;
}

.session-title span {
  margin-top: 2px;
  font-size: 12.5px;
}

.session-meta {
  margin-top: 2px;
  font-size: 12px;
}

.v2-session .progress-track {
  height: 6px;
  border: 1px solid var(--line);
  background: #f7f9fc;
}

.v2-session .progress-fill,
.mini-run .progress-fill,
.running-card .progress-fill {
  background: var(--teal);
}

.v2-session.is-finished .progress-fill {
  background: var(--success);
}

.status-badge {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
}

.session-actions .button {
  min-height: 31px;
  padding: 7px 12px;
  font-size: 12.5px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.pagination-summary {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.pagination-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-button {
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #ffffff;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}

.pagination-button.is-active {
  color: #ffffff;
  background: var(--brand-navy);
  border-color: var(--brand-navy);
}

.pagination-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 860px) {
  .sidebar.is-collapsed {
    width: 100%;
  }
}

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

  .pagination-actions,
  .pagination-button {
    width: 100%;
  }
}

/* Easy Link 2.0 visual system ported from the Claude prototype */
.auth-page {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(238, 241, 245, 0.92), rgba(238, 241, 245, 0.82)),
    repeating-linear-gradient(135deg, rgba(125, 216, 245, 0.18) 0 28px, rgba(221, 230, 240, 0.42) 28px 56px);
}

.auth-shell {
  max-width: 1080px;
  min-height: 620px;
  grid-template-columns: 1fr 1fr;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 56px;
}

.auth-logo {
  width: min(232px, 78%);
  margin-bottom: 14px;
}

.auth-heading h1 {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
}

.auth-heading p {
  color: var(--muted);
  font-size: 13.5px;
}

.brand-panel {
  align-items: center;
  padding: 72px 56px;
  background:
    linear-gradient(135deg, rgba(13, 40, 69, 0.98), rgba(13, 40, 69, 0.94)),
    linear-gradient(135deg, transparent 60%, rgba(125, 216, 245, 0.16) 60%, rgba(125, 216, 245, 0.16) 62%, transparent 62%);
}

.brand-panel-content h2 {
  font-size: 34px;
  line-height: 1.15;
}

.field label,
.label-text {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.field input,
.field select {
  min-height: 42px;
  border: 1.5px solid var(--line);
  color: var(--text);
}

.field input:focus,
.field select:focus,
.file-drop:focus-within {
  border-color: var(--brand-navy);
  box-shadow: none;
}

.button {
  min-height: 38px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: none;
}

.button-primary {
  background: var(--brand-navy);
}

.button-primary:hover:not(:disabled) {
  background: #15375d;
}

.button-secondary,
.button-cyan {
  color: var(--brand-navy);
  background: #ffffff;
  border: 1px solid #bce6f3;
}

.button-secondary:hover:not(:disabled),
.button-cyan:hover:not(:disabled) {
  background: var(--brand-cyan-soft);
}

.button-link {
  min-height: auto;
  padding: 0;
  color: var(--brand-navy);
  background: transparent;
  border: 0;
}

.text-link {
  color: var(--brand-navy);
  font-size: 13px;
  font-weight: 600;
}

.page-footer {
  color: var(--muted);
  background: transparent;
  border-top: 0;
}

.app-page-v2 {
  background: var(--surface-muted);
}

.app-shell-v2 {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface-muted);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 240px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  min-height: 74px;
  display: flex;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand img {
  width: 150px;
  height: auto;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--brand-cyan-soft);
  color: var(--brand-navy);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--brand-navy);
}

.nav-item.is-disabled {
  color: #9aacc0;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  border-radius: 7px;
  color: currentColor;
  background: #f7f9fc;
  font-size: 11px;
  font-weight: 800;
}

.nav-badge,
.soon-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--brand-navy);
  background: var(--brand-cyan);
  font-size: 10.5px;
  font-weight: 800;
}

.soon-badge {
  border-radius: 4px;
  color: var(--muted);
  background: #f7f9fc;
  text-transform: uppercase;
}

.sidebar-live {
  margin: 0 10px 12px;
  padding: 12px;
  border: 1px solid rgba(15, 163, 163, 0.2);
  border-radius: 10px;
  background: var(--teal-soft);
}

.sidebar-live-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-live strong {
  color: var(--teal);
  font-size: 11px;
  text-transform: uppercase;
}

.sidebar-live span:not(.live-dot) {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.live-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 1.4s infinite;
}

.sidebar-user {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
}

.avatar {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand-navy);
  font-size: 13px;
  font-weight: 800;
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user strong {
  color: var(--text);
  font-size: 12.5px;
}

.sidebar-user span {
  color: var(--muted);
  font-size: 11px;
}

.icon-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.icon-button.danger {
  color: var(--danger);
  border-color: rgba(216, 58, 58, 0.25);
}

.app-main-v2 {
  min-width: 0;
  flex: 1;
}

.app-view {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-view.is-active {
  display: block;
  animation: fadeIn 0.18s ease-out both;
}

.content-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.content-topbar h1 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.content-topbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.view-content {
  padding: 24px 28px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card,
.card-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(13, 40, 69, 0.04);
}

.kpi-card {
  min-height: 130px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 18px 20px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi-card strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.kpi-card small {
  color: var(--muted);
  font-size: 11.5px;
}

.accent-green {
  border-color: rgba(30, 158, 96, 0.22);
}

.accent-teal {
  border-color: rgba(15, 163, 163, 0.22);
}

.accent-orange {
  border-color: rgba(232, 138, 28, 0.22);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.dashboard-side {
  display: grid;
  gap: 14px;
}

.card-panel {
  padding: 22px 24px;
}

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

.card-panel h2 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 18px;
}

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

.panel-header h2 {
  margin: 4px 0 0;
}

.panel-header.compact {
  padding: 0;
  margin-bottom: 14px;
  border-bottom: 0;
}

.eyebrow {
  color: var(--teal);
  letter-spacing: 1.2px;
}

.navy-panel {
  color: #ffffff;
  background: var(--brand-navy);
  border: 0;
}

.navy-panel h2,
.navy-panel p {
  color: #ffffff;
}

.navy-panel p,
.info-panel p {
  margin: 8px 0 14px;
  line-height: 1.5;
}

.navy-panel .eyebrow {
  color: var(--brand-cyan);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.pill-orange {
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid rgba(232, 138, 28, 0.3);
}

.pill-yellow {
  color: #9c7a1e;
  background: var(--yellow-soft);
  border: 1px solid rgba(244, 193, 69, 0.45);
}

.pill-cyan {
  color: var(--brand-navy-dark);
  background: var(--brand-cyan-soft);
  border: 1px solid rgba(125, 216, 245, 0.4);
}

.pill-green {
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid rgba(30, 158, 96, 0.28);
}

.pill-navy {
  color: #ffffff;
  background: var(--brand-navy);
  border: 1px solid var(--brand-navy);
}

.pill-purple {
  color: var(--purple);
  background: var(--purple-soft);
  border: 1px solid rgba(124, 92, 219, 0.3);
}

.credential-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bancos-config-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #9eb2c3;
  border-radius: var(--radius);
  color: var(--text);
  background: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.bancos-config-trigger:hover {
  border-color: var(--brand-cyan);
}

.bancos-config-trigger:focus-visible {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(98, 200, 216, 0.24);
}

.bancos-config-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--brand-navy-dark);
  background: var(--brand-cyan-soft);
  font-size: 12px;
  font-weight: 800;
}

.cred-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.cred-chip i,
.credential-health span {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
}

.cred-chip.is-ok {
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid rgba(30, 158, 96, 0.3);
}

.cred-chip.is-ok i,
.credential-health.is-ok span {
  background: var(--success);
}

.cred-chip.is-missing {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(216, 58, 58, 0.3);
}

.cred-chip.is-missing i,
.credential-health.is-missing span {
  background: var(--danger);
}

.credential-health-list {
  display: grid;
  gap: 8px;
}

.credential-health {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f7f9fc;
}

.credential-health strong {
  color: var(--text);
  font-size: 13px;
}

.credential-health em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 800;
}

.credential-health.is-ok em {
  color: var(--success);
}

.credential-health.is-missing em {
  color: var(--danger);
}

.mini-run-list {
  display: grid;
}

.mini-run {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 120px 104px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 22px;
  color: var(--text);
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.mini-run:hover {
  background: #f7f9fc;
}

.mini-run-main strong,
.mini-run-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-run-main small,
.mini-progress small {
  color: var(--muted);
  font-size: 11.5px;
}

.mini-progress {
  display: grid;
  gap: 4px;
  text-align: right;
}

.mini-run .status-badge {
  display: inline-flex;
  align-items: center;
  min-width: 104px;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.consultation-grid,
.credentials-grid-v2 {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(320px, 360px);
  gap: 20px;
  align-items: start;
}

.credentials-grid-v2 {
  grid-template-columns: minmax(340px, 0.85fr) minmax(420px, 1.15fr);
}

.file-drop {
  border-color: var(--line);
  border-radius: 12px;
  background: #f7f9fc;
}

.file-drop.has-file {
  border-color: var(--success);
  background: var(--success-soft);
}

.segmented-control {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
}

.segmented-button {
  border-radius: 7px;
}

.running-list {
  display: grid;
  gap: 10px;
}

.running-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fc;
}

.running-card strong,
.running-card span {
  display: block;
}

.running-card strong {
  color: var(--text);
  font-size: 12.5px;
}

.running-card span {
  color: var(--muted);
  font-size: 11.5px;
}

.running-card b {
  color: var(--teal);
  font-size: 12px;
}

.running-card .progress-track {
  grid-column: 1 / -1;
  height: 5px;
  background: #ffffff;
}

.running-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  grid-column: 1 / -1;
}

.info-panel {
  color: var(--text);
  background: var(--brand-cyan-soft);
  border-color: #bce6f3;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.panel-header + .list-toolbar {
  margin-top: 20px;
}

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.tabs.compact {
  border-radius: 8px;
}

.tab-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.tabs.compact .tab-button {
  min-height: 30px;
  padding: 6px 12px;
  font-size: 12px;
}

.tab-button.is-active {
  color: #ffffff;
  background: var(--brand-navy);
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-search-form input {
  flex: 1 1 220px;
}

.mc-history-card .history-search-form input {
  flex: 1 1 280px;
  min-width: 240px;
}

.filters input {
  min-height: 38px;
  width: 220px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  outline: 0;
}

.v2-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.v2-session {
  width: 100%;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 20px;
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(13, 40, 69, 0.04);
}

.session-body {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
}

.v2-session .session-card-header,
.v2-session .session-meta,
.v2-session .progress-track,
.v2-session .session-footer {
  width: 100%;
}

.v2-session .session-footer {
  justify-content: flex-end;
}

.bank-mark,
.product-mark,
.provider-mark {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--brand-navy);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.bank-mark {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffffff;
}

.bank-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.bank-mark b {
  display: none;
  font-size: inherit;
  font-weight: inherit;
}

.bank-mark.is-fallback {
  color: #ffffff;
  background: var(--brand-navy);
}

.bank-mark.is-fallback img {
  display: none;
}

.bank-mark.is-fallback b {
  display: inline;
}

.bank-mark.mini {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 10px;
}

.credential-bank-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.product-mark.is-fgts {
  background: var(--purple);
}

.product-mark.mini {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 10px;
}

.progress-fill {
  background: linear-gradient(90deg, var(--brand-navy), var(--teal));
}

.progress-fill.status-em-andamento,
.progress-fill.status-finalizando {
  background: var(--teal);
}

.progress-fill.status-finalizado,
.progress-fill.status-concluido {
  background: var(--success);
}

.progress-fill.status-cancelado,
.progress-fill.status-em-pausa {
  background: var(--yellow);
}

.progress-fill.status-falha,
.progress-fill.status-erro,
.progress-fill.status-error,
.progress-fill.status-failed {
  background: var(--danger);
}

.status-finalizado,
.status-concluido {
  color: var(--success);
  background: var(--success-soft);
}

.status-em-andamento,
.status-finalizando {
  color: var(--teal);
  background: var(--teal-soft);
}

.status-cancelado,
.status-em-pausa {
  color: #9c7a1e;
  background: var(--yellow-soft);
}

.status-falha,
.status-failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-running {
  color: var(--teal);
  background: var(--teal-soft);
}

.status-success {
  color: var(--success);
  background: var(--success-soft);
}

.status-neutral {
  color: var(--muted);
  background: var(--surface-muted);
}

.status-error {
  color: var(--danger);
  background: var(--danger-soft);
}

.v2-credentials {
  display: grid;
  gap: 8px;
}

.v2-credential-card {
  display: grid;
  grid-template-columns: 34px minmax(130px, 0.5fr) minmax(220px, 1fr) auto;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
}

.provider-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 12px;
}

.client-id-toggle {
  max-width: none;
}

.soon-view {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 74px);
}

.soon-panel {
  width: min(720px, 100%);
  padding: 40px;
  text-align: center;
}

.soon-panel h2 {
  margin: 14px 0 8px;
  font-size: 24px;
}

.soon-panel p {
  max-width: 440px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state.compact {
  padding: 18px;
}

.progress-fill.is-indeterminate {
  width: 40% !important;
  animation: progressIndeterminate 1.1s ease-in-out infinite;
}

@keyframes progressIndeterminate {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(250%);
  }
}

.field-checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.field-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-navy);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 38px;
  height: 22px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  display: inline-flex;
  align-items: center;
  width: 38px;
  height: 22px;
  padding: 2px;
  border-radius: 999px;
  background: #c7d3dd;
  transition: background 160ms ease;
}

.switch-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(13, 40, 69, 0.25);
  transition: transform 160ms ease;
}

.switch input:checked + .switch-track {
  background: var(--brand-navy);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(98, 200, 216, 0.24);
}

.bancos-config-dialog {
  width: min(560px, calc(100% - 32px));
}

.bancos-config-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bancos-config-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.bancos-config-toolbar-actions {
  display: flex;
  gap: 8px;
}

.bancos-config-list {
  display: grid;
  gap: 8px;
  max-height: min(360px, 50vh);
  overflow-y: auto;
}

.bancos-config-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, 160px);
  gap: 12px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.bancos-config-columns span:nth-child(2) {
  text-align: center;
}

.bancos-config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(120px, 160px);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fc;
}

.bancos-config-bank {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mc-bank-avatar.is-disabled .bank-mark {
  filter: grayscale(1);
  opacity: 0.5;
}

.bancos-config-name {
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bancos-config-row select {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #9eb2c3;
  border-radius: 7px;
  color: var(--text);
  background: #ffffff;
  font-size: 12.5px;
}

.bancos-config-row select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bancos-config-row.no-credential {
  opacity: 0.7;
}

.bancos-config-row.no-credential .switch {
  pointer-events: none;
  cursor: not-allowed;
}

.bancos-config-row.no-credential .bancos-config-name::after {
  content: ' · sem credencial';
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

#openBancosConfig.is-warning {
  border-color: var(--warning, #f59e0b);
  color: var(--warning, #f59e0b);
}

.simulation-dialog {
  width: min(760px, calc(100% - 32px));
}

.mc-scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 4px;
  max-height: min(420px, 60vh);
  overflow-y: auto;
}

.mc-scenario-card {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 12px;
  padding-right: 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.mc-scenario-radio {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #ffffff;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease;
}

.mc-scenario-card.is-selected .mc-scenario-radio {
  border-color: var(--brand-navy);
  background: var(--brand-navy);
}

.mc-scenario-card.is-selected .mc-scenario-radio::after {
  content: '✓';
}

.mc-scenario-card:disabled,
.mc-scenario-card.is-unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}

.mc-scenario-card.is-static {
  cursor: default;
}

.mc-scenario-card.is-selected {
  border-color: var(--brand-cyan);
  background: var(--brand-cyan-soft);
  box-shadow: 0 0 0 2px rgba(125, 216, 245, 0.32);
}

.mc-scenario-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.mc-scenario-value {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.mc-scenario-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: break-word;
  word-break: break-word;
}

.mc-breakdown {
  display: grid;
  gap: 10px;
}

.mc-breakdown[hidden] {
  display: none;
}

.mc-breakdown-title {
  color: var(--brand-navy-dark);
  font-size: 13px;
  font-weight: 800;
}

#histResumoSimulations {
  display: grid;
  gap: 12px;
}

.mc-breakdown-rows {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
  overflow: hidden;
}

.mc-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.mc-breakdown-row:last-child {
  border-bottom: 0;
}

.mc-breakdown-row span {
  color: var(--muted);
}

.mc-breakdown-row strong {
  color: var(--text);
}

.mc-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mc-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mc-stat-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
  text-align: center;
}

.mc-stat-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.mc-stat-value {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.wizard-dialog {
  width: min(640px, calc(100% - 32px));
}

.wizard-panel {
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
}

.wizard-stepper {
  display: flex;
  align-items: flex-start;
  padding: 4px 0 0;
  margin: 0;
  list-style: none;
}

.wizard-step-indicator {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.wizard-step-indicator:not(:first-child)::before {
  content: '';
  position: absolute;
  top: 13px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--line-strong);
  z-index: 0;
}

.wizard-step-indicator.is-active::before,
.wizard-step-indicator.is-done::before {
  background: var(--success);
}

.wizard-step-indicator span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
}

.wizard-step-indicator.is-active {
  color: var(--brand-navy-dark);
}

.wizard-step-indicator.is-active span {
  border-color: var(--brand-navy);
  color: #ffffff;
  background: var(--brand-navy);
}

.wizard-step-indicator.is-done {
  color: var(--success);
}

.wizard-step-indicator.is-done span {
  border-color: var(--success);
  color: #ffffff;
  background: var(--success);
}

.wizard-step {
  display: grid;
  gap: 14px;
}

.wizard-step[data-wizard-step="0"] .form-stack,
.wizard-step[data-wizard-step="1"] .form-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wizard-step .field-checkbox {
  grid-column: 1 / -1;
}

.wizard-review {
  display: grid;
  gap: 16px;
}

.wizard-review-group {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.wizard-review-group h3 {
  margin: 0 0 8px;
  color: var(--brand-navy-dark);
  font-size: 14px;
}

.wizard-review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.wizard-review-row:last-child {
  border-bottom: 0;
}

.wizard-review-row span {
  color: var(--muted);
}

.wizard-review-row strong {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.wizard-done {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px 12px;
  text-align: center;
}

.wizard-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--success);
  font-size: 26px;
  font-weight: 900;
}

.wizard-done h3 {
  margin: 0;
  color: var(--brand-navy-dark);
}

.wizard-done p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
}

.wizard-link-row {
  display: flex;
  width: 100%;
  gap: 8px;
}

.wizard-link-row input {
  flex: 1 1 auto;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #9eb2c3;
  border-radius: var(--radius);
  color: var(--text);
  background: #ffffff;
}

.wizard-share-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wizard-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.wizard-actions #wizardBack {
  margin-right: auto;
}

/* Multi Consultas v2 */

.mc-screen {
  display: grid;
  gap: 20px;
}

.mc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.mc-config-trigger {
  width: auto;
  min-height: 38px;
  padding: 8px 14px;
  gap: 8px;
  border: 1px solid rgba(125, 216, 245, 0.4);
  color: var(--brand-navy-dark);
  background: var(--brand-cyan-soft);
  font-size: 13px;
}

.mc-config-trigger:hover {
  border-color: var(--brand-cyan);
}

.mc-config-trigger .bancos-config-count {
  color: #ffffff;
  background: var(--brand-navy);
}

.mc-config-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: currentColor;
}

.mc-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mc-submit {
  width: 100%;
}

/* Resultados */

.mc-results {
  display: grid;
  gap: 14px;
}

.mc-secondary-panel {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.mc-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.mc-results-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mc-results-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-results-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
}

.mc-progress-pill {
  gap: 8px;
}

.mc-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: mcPulse 1.2s ease-in-out infinite;
}

@keyframes mcPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

.mc-bank-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mc-bank-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.mc-bank-card.is-loading,
.mc-bank-card.is-simulating,
.mc-bank-card.is-fail {
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px 16px;
  text-align: center;
  min-height: 150px;
}

.mc-bank-card.is-loading {
  color: var(--muted);
}

.mc-bank-card.is-fail {
  border-color: rgba(216, 58, 58, 0.24);
  background: var(--danger-soft);
}

.mc-bank-card.is-fail.is-cancelled {
  border-color: var(--line);
  background: var(--surface-muted);
}

.mc-bank-card.is-fail.is-cancelled .mc-bank-fail-icon {
  background: var(--muted);
}

.mc-bank-card.is-success {
  border-color: rgba(30, 158, 96, 0.24);
  background: var(--success-soft);
}

.mc-bank-card.is-best {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 2px rgba(125, 216, 245, 0.32);
}

.mc-best-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--brand-navy);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.mc-bank-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--brand-cyan);
  border-radius: 50%;
  animation: mcSpin 0.8s linear infinite;
}

@keyframes mcSpin {
  to { transform: rotate(360deg); }
}

.mc-bank-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mc-bank-name {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 800;
}

.mc-bank-check {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--success);
  font-size: 12px;
  font-weight: 900;
}

.mc-bank-fail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--danger);
  font-size: 15px;
  font-weight: 900;
}

.mc-bank-margin {
  display: grid;
  gap: 2px;
}

.mc-bank-margin-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.mc-bank-margin-value {
  color: var(--success);
  font-size: 22px;
  font-weight: 900;
}

.mc-bank-status {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.mc-bank-status-detail {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  overflow-wrap: break-word;
  word-break: break-word;
}

.mc-bank-action {
  width: 100%;
}

.mc-bank-soon {
  justify-self: stretch;
  margin-left: 0;
  padding: 8px 10px;
  text-align: center;
  font-size: 11px;
}

.mc-bank-soon.is-success {
  color: var(--success);
  background: var(--success-soft);
}

/* Histórico */

.mc-hist-table {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 0.7fr 0.9fr 0.8fr 0.9fr 48px;
}

.mc-hist-body {
  display: contents;
}

.mc-hist-row {
  display: contents;
}

.mc-hist-head > span,
.mc-hist-row > span,
.mc-hist-row > button {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.mc-hist-head > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--line-strong);
}

.mc-hist-cpf,
.mc-hist-date,
.mc-hist-margin,
.mc-hist-best {
  color: var(--text);
  font-weight: 700;
}

.mc-hist-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-hist-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-navy-dark);
  background: var(--surface-muted);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.mc-hist-eye:hover {
  border-color: var(--brand-cyan);
  color: var(--brand-navy);
}

.mc-hist-eye svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.mc-hist-body .mc-hist-empty,
.mc-hist-body .empty-state,
.mc-hist-body .loading-state {
  grid-column: 1 / -1;
  padding: 24px 10px;
  border-bottom: 0;
  justify-content: center;
  text-align: center;
}

/* Modais */

.hist-resumo-dialog {
  width: min(860px, calc(100% - 32px));
}

.hist-resumo-dialog .mc-modal-panel {
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
}

.hist-resumo-dialog .mc-scenario-grid {
  max-height: none;
  overflow-y: visible;
}

.hist-resumo-dialog .mc-breakdown-rows:not([hidden]) {
  margin-top: 20px;
}

.mc-modal-panel {
  gap: 16px;
}

.mc-modal-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: -24px -24px 0;
  padding: 20px 48px 18px 24px;
  color: #ffffff;
  background: var(--brand-navy);
}

.mc-modal-header > div {
  min-width: 0;
}

.mc-modal-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 17px;
  overflow-wrap: break-word;
}

.mc-modal-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.mc-modal-header strong {
  color: var(--brand-cyan);
}

.mc-modal-header-plain {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.mc-modal-header-plain h2 {
  color: var(--text);
}

.mc-modal-header-plain p {
  color: var(--muted);
}

.mc-modal-header-icon,
.mc-modal-avatar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.mc-modal-header-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.mc-modal-header-icon-cyan {
  color: var(--brand-navy);
  background: var(--brand-cyan-soft);
}

.mc-modal-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.mc-modal-header-date {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.mc-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.mc-modal-header-plain .mc-modal-close {
  color: var(--muted);
  background: var(--surface-muted);
}

@media (max-width: 1120px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .consultation-grid,
  .credentials-grid-v2 {
    grid-template-columns: 1fr;
  }

  .mc-bank-grid,
  .mc-field-grid,
  .mc-scenario-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  /* Filtros multiconsulta */
  .mc-history-card .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mc-history-card .filters {
    flex-wrap: nowrap;
  }

  .mc-history-card .history-search-form {
    flex: 1 1 auto;
    min-width: 0;
  }

  #refreshMultiHistory {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Histórico: tabela vira lista de cards */
  .mc-hist-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mc-hist-head {
    display: none;
  }

  .mc-hist-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mc-hist-body .mc-hist-empty,
  .mc-hist-body .empty-state,
  .mc-hist-body .loading-state {
    grid-column: unset;
    padding: 24px 10px;
  }

  .mc-hist-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name prod"
      "cpf  .   "
      "best .   "
      "date eye ";
    align-items: center;
    gap: 4px 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
  }

  .mc-hist-head > span,
  .mc-hist-row > span,
  .mc-hist-row > button {
    padding: 0;
    border-bottom: 0;
  }

  .mc-hist-name   { grid-area: name; font-size: 13.5px; font-weight: 700; color: var(--text); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mc-hist-prod   { grid-area: prod; justify-content: flex-end; }
  .mc-hist-cpf    { grid-area: cpf; font-size: 12px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mc-hist-best   { grid-area: best; font-size: 12.5px; font-weight: 700; }
  .mc-hist-date   { grid-area: date; font-size: 12px; color: var(--muted); }
  .mc-hist-row > .mc-hist-margin { display: none; }
  .mc-hist-eye    { grid-area: eye; margin: 0; align-self: end; }
}

@media (max-width: 860px) {
  .app-shell-v2 {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand user"
      "nav nav";
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand {
    grid-area: brand;
    min-width: 0;
    min-height: 60px;
    display: flex;
    padding: 10px 14px;
    border-bottom: 0;
  }

  .sidebar-live {
    display: none;
  }

  .sidebar-user {
    grid-area: user;
    display: flex;
    border-bottom: 0;
  }

  .sidebar-user-info,
  .sidebar-actions #sidebarToggle,
  .sidebar-actions #logoutButton span {
    display: none;
  }

  .sidebar-nav {
    grid-area: nav;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 10px 10px;
    border-top: 1px solid var(--line);
    overflow: visible;
  }

  .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 7px 4px;
    text-align: center;
  }

  .nav-label {
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
  }

  .soon-badge {
    display: none;
  }

  .nav-badge {
    position: absolute;
    top: 5px;
    right: calc(50% - 22px);
    margin-left: 0;
  }

  .nav-item.is-active::before {
    display: none;
  }

  .sidebar.is-collapsed {
    width: 100%;
  }

  .sidebar.is-collapsed .sidebar-brand {
    justify-content: flex-start;
    padding: 10px 14px;
  }

  .sidebar.is-collapsed .el-logo-wordmark,
  .sidebar.is-collapsed .nav-label {
    display: grid;
  }

  .sidebar.is-collapsed .nav-item {
    justify-content: center;
    padding: 7px 4px;
  }

  .sidebar.is-collapsed .nav-badge {
    top: 5px;
    right: calc(50% - 22px);
  }

  .content-topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  /* Multiconsulta — tablet */
  .mc-history-card .history-search-form input {
    min-width: 160px;
    flex-basis: 160px;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: 28px 20px;
  }

  .brand-panel {
    min-height: 230px;
    padding: 28px 22px;
  }

  .view-content,
  .content-topbar {
    padding: 16px;
  }

  .sidebar-brand .el-logo-chip {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .sidebar-brand .el-logo-wordmark strong {
    font-size: 16px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .mini-run,
  .v2-session,
  .v2-credential-card {
    grid-template-columns: 1fr;
  }

  .product-mark,
  .provider-mark {
    width: max-content;
    min-width: 44px;
    padding: 0 10px;
  }

  .filters,
  .history-search-form,
  .filters input,
  .tabs,
  .tab-button,
  .form-actions-row .button {
    width: 100%;
  }

  .history-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .history-search-form .button {
    width: auto;
  }

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

  .tab-button {
    justify-content: center;
  }

  [data-view="lista"] .filters .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mc-history-card .filters {
    flex-wrap: wrap;
  }

  #refreshMultiHistory {
    width: 100%;
  }

  .mc-bank-grid,
  .mc-field-grid,
  .mc-scenario-grid,
  .mc-stat-grid,
  .mc-breakdown-grid {
    grid-template-columns: 1fr;
  }

  .mc-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .mc-config-trigger {
    width: 100%;
    justify-content: center;
  }


  .wizard-step[data-wizard-step="0"] .form-stack,
  .wizard-step[data-wizard-step="1"] .form-stack {
    grid-template-columns: 1fr;
  }

  .bancos-config-columns,
  .bancos-config-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(96px, 110px);
    gap: 8px;
  }

  /* Multiconsulta — mobile */

  /* Wizard: todos os steps vão para 1 coluna */
  .wizard-step[data-wizard-step="2"] .form-stack,
  .wizard-step[data-wizard-step="3"] .form-stack {
    grid-template-columns: 1fr;
  }

  /* Valor de margem escala em phones */
  .mc-bank-margin-value {
    font-size: 18px;
  }

  /* Ações do cabeçalho de resultados podem quebrar linha */
  .mc-results-actions {
    flex-wrap: wrap;
  }

  /* Modais mc: padding reduzido + header ajustado */
  .mc-modal .dialog-panel {
    padding: 20px;
  }

  .mc-modal .mc-modal-header {
    margin: -20px -20px 0;
    padding: 16px 44px 14px 20px;
  }
}

/* Scroll lock quando qualquer dialog está aberto */
body:has(dialog[open]) {
  overflow: hidden;
}

/* Final prototype fidelity pass */
.page-footer img {
  width: 86px;
  height: 22px;
  object-fit: contain;
}

body.app-page-v2 {
  overflow: hidden;
  background: #eef1f5;
}

.app-shell-v2,
.app-main-v2,
.app-view.is-active {
  height: 100vh;
  height: 100dvh;
}

.app-main-v2 {
  overflow: hidden;
}

.app-view.is-active:not([data-view="lista"]) {
  overflow-y: auto;
}

.app-view.is-active[data-view="lista"] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-view[data-view="lista"] .content-topbar {
  flex: 0 0 auto;
}

.app-view[data-view="lista"] .view-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-view[data-view="lista"] .list-toolbar,
.app-view[data-view="lista"] .notice,
.app-view[data-view="lista"] .inline-status,
.app-view[data-view="lista"] .pagination {
  flex: 0 0 auto;
}

.app-view[data-view="lista"] .history-list.v2-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.sidebar-brand .el-logo-chip img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.el-logo-chip {
  overflow: hidden;
}

.el-logo-wordmark strong {
  letter-spacing: 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: transparent;
  border-radius: 0;
}

.nav-icon svg,
.icon-button svg,
.button svg,
.kpi-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar.is-collapsed .nav-icon {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}

.nav-item {
  color: #37516b;
  font-weight: 500;
}

.nav-item.is-active {
  color: var(--brand-navy);
  font-weight: 700;
}

.nav-item.is-disabled,
.nav-item.is-disabled:hover {
  color: #9aacc0;
  background: transparent;
  cursor: not-allowed;
  opacity: 0.55;
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px 10px;
}

.sidebar-profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f7f9fc;
}

.sidebar-user-info {
  min-width: 0;
}

.sidebar-actions {
  width: 100%;
  display: flex;
  gap: 6px;
}

.sidebar-actions #sidebarToggle {
  flex: 0 0 36px;
}

.sidebar-actions #logoutButton {
  flex: 1 1 auto;
}

.sidebar.is-collapsed .sidebar-profile-wrap {
  justify-content: center;
}

.sidebar.is-collapsed .sidebar-profile {
  justify-content: center;
  padding: 4px 0;
  background: transparent;
}

.sidebar.is-collapsed .edit-name-btn {
  display: none;
}

.sidebar.is-collapsed .sidebar-actions {
  justify-content: center;
}

.kpi-card {
  min-height: 122px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
}

.kpi-card::after {
  display: none;
}

.kpi-card > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.kpi-card span:not(.kpi-icon) {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.kpi-card strong {
  margin-top: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
}

.kpi-card small {
  color: var(--muted);
  font-size: 11.5px;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  border-radius: 8px;
  color: var(--brand-navy);
  background: rgba(13, 40, 69, 0.08);
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
}

.accent-green .kpi-icon {
  color: var(--success);
  background: rgba(30, 158, 96, 0.10);
}

.accent-teal .kpi-icon {
  color: var(--teal);
  background: rgba(15, 163, 163, 0.10);
}

.accent-orange .kpi-icon {
  color: var(--warning);
  background: rgba(232, 138, 28, 0.10);
}

.kpi-card.is-disabled {
  opacity: 0.62;
  filter: saturate(0.45);
}

.kpi-card.is-disabled strong {
  color: var(--muted);
}

@media (max-width: 860px) {
  body.app-page-v2,
  .app-main-v2,
  .app-view.is-active {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .app-view.is-active[data-view="lista"] {
    display: block;
    overflow: visible;
  }

  .app-view[data-view="lista"] .view-content {
    display: block;
    overflow: visible;
  }

  .app-view[data-view="lista"] .history-list.v2-list {
    max-height: none;
    overflow: visible;
  }
}

.auth-el-logo {
  align-self: center;
  margin: 0 0 14px;
}

.auth-el-logo .el-logo-chip {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.auth-el-logo .el-logo-chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-el-logo .el-logo-wordmark strong {
  font-size: 17.5px;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-user {
  position: relative;
}

.sidebar-profile {
  width: 100%;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sidebar-profile:hover,
.sidebar-profile[aria-expanded="true"] {
  background: #e6f6fc;
}

.user-popover {
  position: absolute;
  left: 10px;
  bottom: calc(100% + 8px);
  z-index: 70;
  width: 220px;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 40px rgba(13, 40, 69, 0.16);
}

.user-popover[hidden] {
  display: none;
}

.user-popover .popover-eyebrow {
  color: var(--teal);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.user-popover strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.user-popover span:not(.popover-eyebrow),
.user-popover small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sidebar.is-collapsed .user-popover {
  left: 58px;
  bottom: 8px;
}

.sidebar-actions .icon-button {
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-actions .icon-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.sidebar-actions #sidebarToggle svg {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.sidebar-actions #logoutButton {
  min-width: 0;
  padding: 0 11px;
}

.sidebar-actions #logoutButton span {
  min-width: 0;
  display: inline;
  overflow: hidden;
  color: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-actions .theme-toggle {
  flex: 0 0 36px;
  width: 36px;
}

.sidebar.is-collapsed .sidebar-actions {
  flex-wrap: wrap;
}

.sidebar.is-collapsed .sidebar-actions #sidebarToggle {
  width: 36px;
  flex-basis: 36px;
}

@media (max-width: 860px) {
  .sidebar-user {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 10px 0;
  }

  .sidebar-profile {
    width: auto;
    flex: 0 0 auto;
    padding: 4px;
    background: transparent;
  }

  .sidebar-actions {
    width: auto;
  }

  .sidebar-actions #sidebarToggle {
    display: none;
  }

  .sidebar-actions #logoutButton {
    flex: 0 0 36px;
    width: 36px;
    padding: 0;
  }

  .sidebar-actions #logoutButton span {
    display: none;
  }

  .user-popover,
  .sidebar.is-collapsed .user-popover {
    top: calc(100% + 4px);
    right: 10px;
    bottom: auto;
    left: auto;
  }

  .sidebar.is-collapsed .sidebar-user {
    flex-direction: row;
    gap: 8px;
  }

  .sidebar.is-collapsed .sidebar-profile {
    justify-content: center;
    padding: 4px;
  }

  .sidebar.is-collapsed .sidebar-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
}

.info-panel {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 28px;
}

.info-panel .tip-copy {
  min-width: 0;
  flex: 1;
}

.info-panel .info-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  border-radius: 8px;
  color: var(--brand-navy);
  background: #ffffff;
  border: 1px solid #bce6f3;
}

.info-panel .info-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-panel strong {
  display: block;
  color: var(--brand-navy);
  font-size: 12.5px;
  line-height: 1.2;
  margin-bottom: 3px;
}

.info-panel p {
  margin: 0;
  min-height: 52px;
  color: #37516b;
  font-size: 12px;
  line-height: 1.45;
}

.tip-progress {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(217, 154, 0, 0.16);
}

.tip-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4c145, #d99a00);
}

.tip-progress.is-running span {
  animation: tipProgress var(--tip-duration, 12000ms) linear forwards;
}

@keyframes tipProgress {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tip-progress.is-running span {
    animation: none;
    width: 100%;
  }
}

.environment-badge {
  display: none;
}

.auth-el-logo .el-logo-chip {
  width: 70px;
  height: 70px;
  flex-basis: 70px;
  border-radius: 13px;
}

.auth-el-logo .el-logo-wordmark strong {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-el-logo {
  gap: 15px;
  margin-bottom: 22px;
}

.info-panel .info-icon {
  color: #d99a00;
  background: #fff5cc;
  border-color: rgba(244, 193, 69, 0.55);
  box-shadow: 0 0 0 3px rgba(244, 193, 69, 0.18);
}

.auth-shell-form-only {
  width: min(480px, 100%);
  min-height: auto;
  grid-template-columns: 1fr;
}

.auth-shell-form-only .auth-panel {
  padding: 48px;
}

/* Login background and brand panel aligned with the auxiliary prototype */
.auth-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #eef1f5;
}

.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath d='M-20 100 L60 20 L80 40 L0 120 Z' fill='%23dde6f0' opacity='0.55'/%3E%3Cpath d='M40 140 L120 60 L140 80 L60 160 Z' fill='%23cfe6f3' opacity='0.45'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  pointer-events: none;
}

.auth-shell {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.brand-panel {
  position: relative;
  justify-content: center;
  overflow: hidden;
  background: var(--brand-navy);
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background:
    linear-gradient(135deg, transparent 60%, var(--brand-cyan) 60%, var(--brand-cyan) 62%, transparent 62%),
    linear-gradient(135deg, transparent 70%, var(--brand-cyan) 70%, var(--brand-cyan) 71%, transparent 71%);
  pointer-events: none;
}

.brand-panel-content {
  position: relative;
}

.brand-panel .eyebrow {
  color: var(--brand-cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 18px;
}

.brand-panel-content h2 {
  color: #ffffff;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand-panel-content p {
  max-width: 380px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

/* Auth readability pass */
.auth-page::before {
  opacity: 0.34;
}

.auth-shell {
  border: 1px solid rgba(13, 40, 69, 0.12);
  box-shadow: 0 24px 64px rgba(13, 40, 69, 0.16);
}

.auth-panel {
  background: rgba(255, 255, 255, 0.98);
}

.auth-heading h1 {
  color: var(--brand-navy-dark);
  font-weight: 800;
}

.auth-heading p {
  color: #425d77;
  font-size: 14px;
  line-height: 1.55;
}

.auth-page .field label {
  color: var(--brand-navy-dark);
  font-weight: 700;
}

.auth-page .field input {
  border-color: #8298ab;
  background: #ffffff;
}

.auth-page .field input:focus {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(125, 216, 245, 0.34);
}

.auth-page .button-primary {
  font-weight: 700;
}

.auth-page .text-link {
  color: #123b63;
  font-weight: 700;
}

.brand-panel .eyebrow {
  color: #a9ebff;
}

.brand-panel-content p {
  color: rgba(255, 255, 255, 0.88);
}

.auth-page .inline-status.is-neutral {
  color: #123b63;
  border: 1px solid rgba(18, 59, 99, 0.12);
}

.auth-page .inline-status.is-error {
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.16);
}

.auth-page .inline-status.is-success {
  color: #16784a;
  border: 1px solid rgba(22, 120, 74, 0.16);
}

.auth-page .page-footer {
  color: #425d77;
  background: rgba(255, 255, 255, 0.76);
  border-top: 1px solid rgba(13, 40, 69, 0.08);
  backdrop-filter: blur(8px);
}

.pagination {
  align-items: center;
}

.pagination-meta {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.pagination-meta strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

.pagination-meta small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.pagination-button {
  min-width: 34px;
}

.pagination-button.pagination-icon {
  width: 34px;
  padding: 7px 0;
  font-weight: 800;
}

.pagination-button[aria-current="page"] {
  box-shadow: 0 0 0 2px rgba(13, 40, 69, 0.08);
}

.pagination-ellipsis {
  min-width: 24px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .pagination-meta {
    text-align: center;
  }

  .pagination-actions {
    justify-content: center;
  }

  .pagination-button {
    width: auto;
    flex: 1 1 auto;
  }

  .pagination-button.pagination-icon {
    flex: 0 0 40px;
  }
}

/* Post-login contrast pass */
.app-page-v2 {
  --muted: #5d7288;
  --line: rgba(13, 40, 69, 0.13);
  --line-strong: rgba(13, 40, 69, 0.24);
  --surface-muted: #e9eef4;
  color: var(--text);
  background: #e9eef4;
}

.app-page-v2 .app-shell-v2 {
  background: #e9eef4;
}

.app-page-v2 .sidebar,
.app-page-v2 .content-topbar,
.app-page-v2 .card-panel,
.app-page-v2 .kpi-card,
.app-page-v2 .session-card,
.app-page-v2 .credential-card,
.app-page-v2 .tabs,
.app-page-v2 .pagination {
  border-color: var(--line);
}

.app-page-v2 .card-panel,
.app-page-v2 .kpi-card,
.app-page-v2 .v2-session,
.app-page-v2 .v2-credential-card,
.app-page-v2 .pagination {
  box-shadow: 0 1px 3px rgba(13, 40, 69, 0.07);
}

.app-page-v2 .content-topbar {
  background: rgba(255, 255, 255, 0.98);
}

.app-page-v2 .content-topbar h1,
.app-page-v2 .card-panel h2,
.app-page-v2 .session-title strong,
.app-page-v2 .mini-run-main strong,
.app-page-v2 .credential-health strong,
.app-page-v2 .credential-provider strong,
.app-page-v2 .running-card strong {
  color: #0a1f36;
}

.app-page-v2 .content-topbar p,
.app-page-v2 .kpi-card small,
.app-page-v2 .mini-run-main small,
.app-page-v2 .mini-progress small,
.app-page-v2 .running-card span,
.app-page-v2 .session-title span,
.app-page-v2 .session-meta,
.app-page-v2 .empty-state span {
  color: #5d7288;
}

.app-page-v2 .nav-item {
  color: #2f4963;
}

.app-page-v2 .nav-item:hover {
  background: #f1f7fa;
  color: var(--brand-navy);
}

.app-page-v2 .nav-item.is-active {
  background: #dff3fb;
  color: var(--brand-navy);
}

.app-page-v2 .nav-item.is-disabled {
  color: #8296aa;
}

.app-page-v2 .sidebar-profile {
  background: #f3f6f9;
  border: 1px solid rgba(13, 40, 69, 0.06);
}

.app-page-v2 .sidebar-profile:hover,
.app-page-v2 .sidebar-profile[aria-expanded="true"] {
  background: #e6f6fc;
  border-color: #bce6f3;
}

.app-page-v2 .sidebar-user span,
.app-page-v2 .soon-badge,
.app-page-v2 .pagination-meta small {
  color: #637a91;
}

.app-page-v2 .field input,
.app-page-v2 .field select,
.app-page-v2 .filters input,
.app-page-v2 .client-id-toggle {
  border-color: #b2c1cf;
  color: #0d2845;
}

.app-page-v2 .field input::placeholder,
.app-page-v2 .filters input::placeholder {
  color: #7c8fa2;
}

.app-page-v2 .field input:focus,
.app-page-v2 .field select:focus,
.app-page-v2 .filters input:focus,
.app-page-v2 .client-id-toggle:focus-visible {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(13, 40, 69, 0.10);
}

.app-page-v2 .button-secondary,
.app-page-v2 .button-cyan {
  border-color: #9ed8ea;
  color: var(--brand-navy);
}

.app-page-v2 .button-secondary:hover:not(:disabled),
.app-page-v2 .button-cyan:hover:not(:disabled) {
  background: #e6f6fc;
  border-color: #7dd8f5;
}

.app-page-v2 .tabs {
  background: #ffffff;
}

.app-page-v2 .tab-button {
  color: #556c83;
}

.app-page-v2 .tab-button:not(.is-active):hover {
  background: #f1f4f8;
  color: var(--text);
}

.app-page-v2 .tab-button.is-active {
  color: #ffffff;
  background: var(--brand-navy);
}

.app-page-v2 .v2-session:hover,
.app-page-v2 .mini-run:hover,
.app-page-v2 .v2-credential-card:hover {
  background: #f8fbfd;
  border-color: var(--line-strong);
}

.app-page-v2 .progress-track {
  background: #dbe4ec;
  border-color: rgba(13, 40, 69, 0.12);
}

.app-page-v2 .status-badge,
.app-page-v2 .pill,
.app-page-v2 .cred-chip {
  font-weight: 700;
}

.app-page-v2 .status-finalizado,
.app-page-v2 .cred-chip.is-ok {
  color: #147447;
  background: #dff3e8;
  border: 1px solid rgba(30, 158, 96, 0.28);
}

.app-page-v2 .status-em-andamento,
.app-page-v2 .status-finalizando {
  color: #087a7a;
  background: #d9f0f0;
  border: 1px solid rgba(15, 163, 163, 0.25);
}

.app-page-v2 .status-cancelado,
.app-page-v2 .status-em-pausa,
.app-page-v2 .pill-orange {
  color: #a26008;
  background: #fce8c8;
  border: 1px solid rgba(232, 138, 28, 0.32);
}

.app-page-v2 .status-falha,
.app-page-v2 .status-erro,
.app-page-v2 .status-error,
.app-page-v2 .status-failed,
.app-page-v2 .cred-chip.is-missing {
  color: #b72d2d;
  background: #f9dddd;
  border: 1px solid rgba(216, 58, 58, 0.28);
}

.app-page-v2 .credential-health {
  background: #f2f6f9;
  border: 1px solid rgba(13, 40, 69, 0.07);
}

.app-page-v2 .running-card,
.app-page-v2 .file-drop,
.app-page-v2 .segmented-control,
.app-page-v2 .empty-state,
.app-page-v2 .loading-state {
  background: #f6f9fb;
  border-color: var(--line);
}

.app-page-v2 .file-drop {
  min-height: 136px;
  justify-items: center;
  gap: 6px;
  padding: 30px 20px;
  border-width: 1.5px;
  border-radius: 12px;
  text-align: center;
}

.app-page-v2 .file-drop strong {
  max-width: 100%;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.app-page-v2 .file-drop span {
  color: #61768a;
  font-size: 12.5px;
}

.app-page-v2 .file-drop small {
  color: #8a9caf;
  font-size: 11.5px;
  font-weight: 600;
}

.app-page-v2 .file-drop.has-file {
  border-color: rgba(30, 158, 96, 0.42);
  background: var(--success-soft);
}

.app-page-v2 .file-drop.has-file small {
  color: var(--success);
}

.app-page-v2 .file-drop.is-dragging {
  border-color: var(--brand-navy);
  background: var(--brand-cyan-soft);
}

.app-page-v2 .empty-state strong,
.app-page-v2 .loading-state {
  color: #0a1f36;
}

.app-page-v2 .pagination-button {
  color: #4f657b;
  border-color: var(--line);
}

.app-page-v2 .pagination-button:not(:disabled):hover {
  color: var(--brand-navy);
  border-color: var(--line-strong);
  background: #f1f7fa;
}

.app-page-v2 .pagination-button.is-active,
.app-page-v2 .pagination-button[aria-current="page"] {
  color: #ffffff;
  background: var(--brand-navy);
  border-color: var(--brand-navy);
}

.app-page-v2 .navy-panel h2,
.app-page-v2 .navy-panel p {
  color: #ffffff;
}

.app-page-v2 .navy-panel p {
  color: #a5e5f7;
  font-size: 12.5px;
}

/* Dark theme */
html[data-theme="dark"] body {
  color: var(--text);
  background: #091421;
}

html[data-theme="dark"] .theme-toggle-floating {
  color: #dcecf8;
  border-color: rgba(201, 220, 238, 0.18);
  background: rgba(16, 32, 51, 0.9);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .theme-toggle-floating:hover {
  background: rgba(22, 42, 63, 0.98);
  border-color: rgba(201, 220, 238, 0.28);
}

html[data-theme="dark"] .auth-page {
  background: #08111d;
}

html[data-theme="dark"] .auth-page::before {
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath d='M-20 100 L60 20 L80 40 L0 120 Z' fill='%231a3248' opacity='0.7'/%3E%3Cpath d='M40 140 L120 60 L140 80 L60 160 Z' fill='%23102b43' opacity='0.72'/%3E%3C/svg%3E");
}

html[data-theme="dark"] .auth-shell {
  border-color: rgba(201, 220, 238, 0.14);
  background: #102033;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .auth-panel {
  background: rgba(16, 32, 51, 0.98);
}

html[data-theme="dark"] .auth-heading h1,
html[data-theme="dark"] .auth-page .field label,
html[data-theme="dark"] .section-heading h1,
html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .credentials-header h1,
html[data-theme="dark"] .empty-state strong {
  color: var(--text);
}

html[data-theme="dark"] .auth-heading p {
  color: #aec1d2;
}

html[data-theme="dark"] .auth-page .field input,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select {
  color: var(--text);
  border-color: rgba(201, 220, 238, 0.22);
  background: #0b1726;
}

html[data-theme="dark"] .auth-page .field input:focus,
html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .field select:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(125, 216, 245, 0.18);
}

html[data-theme="dark"] .auth-page .text-link {
  color: #9ddff3;
}

html[data-theme="dark"] .auth-page .page-footer,
html[data-theme="dark"] .page-footer {
  color: #9db3c7;
  border-color: rgba(201, 220, 238, 0.12);
  background: rgba(9, 20, 33, 0.82);
}

html[data-theme="dark"] .credentials-page,
html[data-theme="dark"] .credentials-layout {
  background: #091421;
}

html[data-theme="dark"] .credentials-header,
html[data-theme="dark"] .credentials-surface,
html[data-theme="dark"] .credential-card,
html[data-theme="dark"] .client-id-toggle,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .dialog-panel,
html[data-theme="dark"] .announcement-panel {
  color: var(--text);
  border-color: var(--line);
  background: #102033;
}

html[data-theme="dark"] .announcement-actions {
  border-top-color: rgba(201, 220, 238, 0.12);
  background: #0c1928;
}

html[data-theme="dark"] .client-id-toggle:hover,
html[data-theme="dark"] .client-id-toggle:focus-visible {
  border-color: var(--brand-cyan);
}

html[data-theme="dark"] .client-id-value,
html[data-theme="dark"] .toast-copy strong,
html[data-theme="dark"] .dialog-panel h2,
html[data-theme="dark"] .announcement-copy h2 {
  color: var(--text);
}

html[data-theme="dark"] .toast-copy span,
html[data-theme="dark"] .dialog-panel p,
html[data-theme="dark"] .announcement-copy p,
html[data-theme="dark"] .announcement-preference {
  color: #b0c3d3;
}

html[data-theme="dark"] .toast-close {
  color: #9db3c7;
}

html[data-theme="dark"] .toast-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .button-ghost {
  color: #dcecf8;
  border-color: rgba(125, 216, 245, 0.28);
  background: rgba(125, 216, 245, 0.12);
}

html[data-theme="dark"] .button-secondary:hover:not(:disabled),
html[data-theme="dark"] .button-ghost:hover:not(:disabled) {
  background: rgba(125, 216, 245, 0.18);
}

html[data-theme="dark"] .app-page-v2 {
  --muted: #9db3c7;
  --line: rgba(201, 220, 238, 0.12);
  --line-strong: rgba(201, 220, 238, 0.22);
  --surface-muted: #091421;
  color: var(--text);
  background: #091421;
}

html[data-theme="dark"] .app-page-v2 .app-shell-v2 {
  background: #091421;
}

html[data-theme="dark"] .app-page-v2 .sidebar,
html[data-theme="dark"] .app-page-v2 .content-topbar,
html[data-theme="dark"] .app-page-v2 .card-panel,
html[data-theme="dark"] .app-page-v2 .kpi-card,
html[data-theme="dark"] .app-page-v2 .session-card,
html[data-theme="dark"] .app-page-v2 .credential-card,
html[data-theme="dark"] .app-page-v2 .tabs,
html[data-theme="dark"] .app-page-v2 .pagination,
html[data-theme="dark"] .app-page-v2 .user-popover {
  color: var(--text);
  border-color: var(--line);
  background: #102033;
}

html[data-theme="dark"] .app-page-v2 .content-topbar {
  background: rgba(16, 32, 51, 0.96);
}

html[data-theme="dark"] .app-page-v2 .card-panel,
html[data-theme="dark"] .app-page-v2 .kpi-card,
html[data-theme="dark"] .app-page-v2 .v2-session,
html[data-theme="dark"] .app-page-v2 .mini-run,
html[data-theme="dark"] .app-page-v2 .v2-credential-card,
html[data-theme="dark"] .app-page-v2 .pagination {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .app-page-v2 .mini-run {
  color: var(--text);
  border-color: var(--line);
  background: #102033;
}

html[data-theme="dark"] .app-page-v2 .content-topbar h1,
html[data-theme="dark"] .app-page-v2 .card-panel h2,
html[data-theme="dark"] .app-page-v2 .session-title strong,
html[data-theme="dark"] .app-page-v2 .mini-run-main strong,
html[data-theme="dark"] .app-page-v2 .credential-health strong,
html[data-theme="dark"] .app-page-v2 .credential-provider strong,
html[data-theme="dark"] .app-page-v2 .running-card strong,
html[data-theme="dark"] .app-page-v2 .empty-state strong,
html[data-theme="dark"] .app-page-v2 .loading-state {
  color: var(--text);
}

html[data-theme="dark"] .app-page-v2 .content-topbar p,
html[data-theme="dark"] .app-page-v2 .kpi-card small,
html[data-theme="dark"] .app-page-v2 .mini-run-main small,
html[data-theme="dark"] .app-page-v2 .mini-progress small,
html[data-theme="dark"] .app-page-v2 .running-card span,
html[data-theme="dark"] .app-page-v2 .session-title span,
html[data-theme="dark"] .app-page-v2 .session-meta,
html[data-theme="dark"] .app-page-v2 .empty-state span,
html[data-theme="dark"] .app-page-v2 .sidebar-user span,
html[data-theme="dark"] .app-page-v2 .soon-badge,
html[data-theme="dark"] .app-page-v2 .pagination-meta small,
html[data-theme="dark"] .user-popover span:not(.popover-eyebrow),
html[data-theme="dark"] .user-popover small {
  color: #9db3c7;
}

html[data-theme="dark"] .app-page-v2 .mc-bank-soon {
  background: rgba(255, 255, 255, 0.06);
  color: #9db3c7;
}

html[data-theme="dark"] .app-page-v2 .nav-item {
  color: #c0d3e3;
}

html[data-theme="dark"] .app-page-v2 .nav-item:hover {
  color: #ffffff;
  background: rgba(125, 216, 245, 0.12);
}

html[data-theme="dark"] .app-page-v2 .nav-item.is-active {
  color: #ffffff;
  background: rgba(125, 216, 245, 0.18);
}

html[data-theme="dark"] .app-page-v2 .nav-item.is-disabled {
  color: #71869a;
}

html[data-theme="dark"] .app-page-v2 .sidebar-profile,
html[data-theme="dark"] .app-page-v2 .credential-health,
html[data-theme="dark"] .app-page-v2 .running-card,
html[data-theme="dark"] .app-page-v2 .file-drop,
html[data-theme="dark"] .app-page-v2 .segmented-control,
html[data-theme="dark"] .app-page-v2 .empty-state,
html[data-theme="dark"] .app-page-v2 .loading-state {
  color: var(--text);
  border-color: var(--line);
  background: #0c1928;
}

html[data-theme="dark"] .app-page-v2 .icon-button {
  color: #c0d3e3;
  border-color: var(--line);
  background: #0c1928;
}

html[data-theme="dark"] .app-page-v2 .icon-button:hover {
  color: #ffffff;
  background: rgba(125, 216, 245, 0.1);
}

html[data-theme="dark"] .app-page-v2 .icon-button.danger {
  color: #ff9b9b;
  border-color: rgba(216, 58, 58, 0.28);
  background: rgba(216, 58, 58, 0.12);
}

html[data-theme="dark"] .app-page-v2 .sidebar-actions #sidebarToggle {
  color: #c0d3e3;
  border-color: var(--line);
  background: #0c1928;
}

html[data-theme="dark"] .app-page-v2 .sidebar-actions #sidebarToggle:hover {
  color: #ffffff;
  background: rgba(125, 216, 245, 0.1);
}

html[data-theme="dark"] .app-page-v2 .sidebar-profile:hover,
html[data-theme="dark"] .app-page-v2 .sidebar-profile[aria-expanded="true"] {
  border-color: rgba(125, 216, 245, 0.24);
  background: rgba(125, 216, 245, 0.1);
}

html[data-theme="dark"] .app-page-v2 .field input,
html[data-theme="dark"] .app-page-v2 .field select,
html[data-theme="dark"] .app-page-v2 .filters input,
html[data-theme="dark"] .app-page-v2 .client-id-toggle {
  color: var(--text);
  border-color: rgba(201, 220, 238, 0.2);
  background: #0b1726;
}

html[data-theme="dark"] .app-page-v2 .field input::placeholder,
html[data-theme="dark"] .app-page-v2 .filters input::placeholder {
  color: #7f95aa;
}

html[data-theme="dark"] .app-page-v2 .field input:focus,
html[data-theme="dark"] .app-page-v2 .field select:focus,
html[data-theme="dark"] .app-page-v2 .filters input:focus,
html[data-theme="dark"] .app-page-v2 .client-id-toggle:focus-visible {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(125, 216, 245, 0.16);
}

html[data-theme="dark"] .app-page-v2 .button-secondary,
html[data-theme="dark"] .app-page-v2 .button-cyan {
  color: #dcecf8;
  border-color: rgba(125, 216, 245, 0.3);
  background: rgba(125, 216, 245, 0.12);
}

html[data-theme="dark"] .app-page-v2 .button-link {
  color: #ffffff;
}

html[data-theme="dark"] .app-page-v2 .button-secondary:hover:not(:disabled),
html[data-theme="dark"] .app-page-v2 .button-cyan:hover:not(:disabled) {
  background: rgba(125, 216, 245, 0.18);
  border-color: rgba(125, 216, 245, 0.42);
}

html[data-theme="dark"] .app-page-v2 .tab-button {
  color: #a9bfd2;
}

html[data-theme="dark"] .app-page-v2 .tab-button:not(.is-active):hover,
html[data-theme="dark"] .app-page-v2 .v2-session:hover,
html[data-theme="dark"] .app-page-v2 .mini-run:hover,
html[data-theme="dark"] .app-page-v2 .v2-credential-card:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .app-page-v2 .progress-track {
  border-color: rgba(201, 220, 238, 0.1);
  background: #15283b;
}

html[data-theme="dark"] .app-page-v2 .progress-percent {
  color: #ffffff;
}

html[data-theme="dark"] .app-page-v2 .file-drop span {
  color: #a7bbcc;
}

html[data-theme="dark"] .app-page-v2 .file-drop small {
  color: #8298ab;
}

html[data-theme="dark"] .app-page-v2 .file-drop.has-file {
  border-color: rgba(30, 158, 96, 0.42);
  background: rgba(30, 158, 96, 0.16);
}

html[data-theme="dark"] .app-page-v2 .file-drop.is-dragging {
  border-color: var(--brand-cyan);
  background: rgba(125, 216, 245, 0.14);
}

html[data-theme="dark"] .app-page-v2 .upload-limit-note {
  color: #dcecf8;
  border: 1px solid rgba(125, 216, 245, 0.24);
  background: rgba(125, 216, 245, 0.1);
}

html[data-theme="dark"] .app-page-v2 .upload-limit-note strong {
  color: #ffffff;
}

html[data-theme="dark"] .app-page-v2 .upload-limit-note span {
  color: #b8cddd;
}

html[data-theme="dark"] .app-page-v2 .pagination-button {
  color: #bfd2e2;
  border-color: var(--line);
  background: #0c1928;
}

html[data-theme="dark"] .app-page-v2 .pagination-button:not(:disabled):hover {
  color: #ffffff;
  background: rgba(125, 216, 245, 0.12);
}

html[data-theme="dark"] .app-page-v2 .pagination-button.is-active,
html[data-theme="dark"] .app-page-v2 .pagination-button[aria-current="page"] {
  color: #ffffff;
  border-color: rgba(125, 216, 245, 0.42);
  background: var(--brand-navy);
  box-shadow: 0 0 0 2px rgba(125, 216, 245, 0.16);
}

html[data-theme="dark"] .app-page-v2 .pagination-ellipsis {
  color: #9db3c7;
}

html[data-theme="dark"] .info-panel .info-icon {
  background: rgba(244, 193, 69, 0.14);
}

html[data-theme="dark"] .info-panel strong {
  color: var(--text);
}

html[data-theme="dark"] .info-panel p {
  color: #b0c3d3;
}

html[data-theme="dark"] .auth-el-logo .el-logo-wordmark strong:first-child,
html[data-theme="dark"] .sidebar-brand .el-logo-wordmark strong:first-child {
  color: #ffffff;
}

html[data-theme="dark"] .app-page-v2 .bancos-config-trigger,
html[data-theme="dark"] .app-page-v2 .wizard-link-row input {
  color: var(--text);
  border-color: rgba(201, 220, 238, 0.22);
  background: #0b1726;
}

html[data-theme="dark"] .app-page-v2 .bancos-config-row,
html[data-theme="dark"] .app-page-v2 .mc-scenario-card,
html[data-theme="dark"] .app-page-v2 .mc-breakdown-rows,
html[data-theme="dark"] .app-page-v2 .mc-stat-card {
  color: var(--text);
  border-color: var(--line);
  background: #0c1928;
}

html[data-theme="dark"] .app-page-v2 .bancos-config-row select {
  color: var(--text);
  border-color: rgba(201, 220, 238, 0.22);
  background: #0b1726;
}

html[data-theme="dark"] .app-page-v2 .mc-config-trigger,
html[data-theme="dark"] .app-page-v2 .pill-cyan {
  color: #dcecf8;
  border-color: rgba(125, 216, 245, 0.3);
  background: rgba(125, 216, 245, 0.12);
}

html[data-theme="dark"] .app-page-v2 .mc-modal-header-icon-cyan {
  color: #dcecf8;
  background: rgba(125, 216, 245, 0.12);
}

html[data-theme="dark"] .app-page-v2 .mc-breakdown-title,
html[data-theme="dark"] .app-page-v2 .wizard-review-group h3,
html[data-theme="dark"] .app-page-v2 .mc-hist-eye,
html[data-theme="dark"] .app-page-v2 .wizard-step-indicator.is-active {
  color: var(--text);
}

html[data-theme="dark"] .app-page-v2 .switch-track {
  background: rgba(201, 220, 238, 0.22);
}

html[data-theme="dark"] .app-page-v2 .switch input:checked + .switch-track {
  background: var(--brand-cyan);
}

html[data-theme="dark"] .app-page-v2 .switch input:checked + .switch-track .switch-thumb {
  background: #102033;
}

/* ── WhatsApp community card ─────────────────────────────── */

@keyframes wpp-float {
  0%, 100% {
    transform: translateY(0px);
    box-shadow:
      0 4px 8px  rgba(0, 0, 0, 0.12),
      0 1px 3px  rgba(0, 0, 0, 0.08);
  }
  50% {
    transform: translateY(-5px);
    box-shadow:
      0 12px 24px rgba(0, 0, 0, 0.10),
      0 4px  8px  rgba(0, 0, 0, 0.06);
  }
}

.sidebar-whatsapp {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 10px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #e6f8ec;
  border: 1px solid rgba(18, 140, 126, 0.55);
  color: #128c7e;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  min-width: 0;
  animation: wpp-float 3.2s ease-in-out infinite;
  transition: background 0.15s;
}

.sidebar-whatsapp:hover {
  background: #b2e8c8;
  animation-play-state: paused;
}

.sidebar-whatsapp:hover::before {
  border-top-color: rgba(18, 140, 126, 0.65);
}

.sidebar-whatsapp:hover::after {
  border-top-color: #b2e8c8;
}

/* Triângulo externo (borda) */
.sidebar-whatsapp::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 18px;
  border: 8px solid transparent;
  border-top-color: rgba(37, 211, 102, 0.28);
  border-bottom: 0;
  pointer-events: none;
}

/* Triângulo interno (preenchimento) */
.sidebar-whatsapp::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 19px;
  border: 7px solid transparent;
  border-top-color: #e6f8ec;
  border-bottom: 0;
  pointer-events: none;
}

.sidebar-whatsapp-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-whatsapp-icon img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.sidebar-whatsapp-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.is-collapsed .sidebar-whatsapp {
  display: none;
}

/* ── Edit name button ────────────────────────────────────── */

.sidebar-profile-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-profile-wrap .sidebar-profile {
  flex: 1 1 auto;
  min-width: 0;
}

.edit-name-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.sidebar-profile-wrap:hover .edit-name-btn,
.edit-name-btn:focus-visible {
  opacity: 1;
}

.edit-name-btn:hover {
  color: var(--brand-cyan);
  background: rgba(15, 163, 163, 0.1);
  opacity: 1;
}

.edit-name-btn svg {
  width: 13px;
  height: 13px;
}

/* Dark mode */
html[data-theme="dark"] .app-page-v2 .sidebar-whatsapp {
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.22);
  color: #4ade80;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .app-page-v2 .sidebar-whatsapp:hover {
  background: rgba(37, 211, 102, 0.16);
}

html[data-theme="dark"] .app-page-v2 .sidebar-whatsapp:hover::before {
  border-top-color: rgba(37, 211, 102, 0.32);
}

html[data-theme="dark"] .app-page-v2 .sidebar-whatsapp:hover::after {
  border-top-color: #0e3328;
}

html[data-theme="dark"] .app-page-v2 .sidebar-whatsapp::before {
  border-top-color: rgba(37, 211, 102, 0.25);
}

html[data-theme="dark"] .app-page-v2 .sidebar-whatsapp::after {
  border-top-color: rgba(22, 46, 34, 0.95);
}

html[data-theme="dark"] .app-page-v2 .edit-name-btn:hover {
  color: #7dd8f5;
  background: rgba(125, 216, 245, 0.1);
}

@media (max-width: 860px) {
  .sidebar-whatsapp {
    display: none;
  }
}
