﻿@font-face {
  font-family: 'Roboto';
  src: url('/fonts/Roboto-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('/fonts/Roboto-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('/fonts/Roboto-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto';
  src: url('/fonts/Roboto-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Habita Manual de Normas — PANTONE 275C / 361C / 7739C / 2119C */
  --accent: #2D9C48;
  --accent-muted: rgba(45, 156, 72, 0.12);
  --brand-navy: #191847;
  --brand-green: #2D9C48;
  --primary-1: #191847;
  --primary-2: #2D9C48;
  --primary-3: #1F2C5C;
  --primary-4: #53AF3B;
  --color-error: #C13C3C;
  --color-success: #2D9C48;
  --color-info: #3B6BD4;
  --color-warning: #F2C94C;

  /* Value tones: one palette for every badge (estado + natureza) across the app */
  --tone-em-curso-bg: #dbeafe;
  --tone-em-curso-fg: #1e40af;
  --tone-concluido-bg: #dcfce7;
  --tone-concluido-fg: #166534;
  --tone-perdido-bg: #fee2e2;
  --tone-perdido-fg: #991b1b;
  --tone-venda-bg: var(--accent-muted);
  --tone-venda-fg: var(--accent);
  --tone-arrendamento-bg: #ffedd5;
  --tone-arrendamento-fg: #9a3412;
  --tone-aprovado-bg: #ede9fe;
  --tone-aprovado-fg: #6d28d9;

  /* Legacy aliases (used across app.css) */
  --navy: var(--brand-navy);
  --navy-deep: var(--primary-3);
  --navy-light: #252458;
  --navy-card: var(--primary-3);
  --green: var(--brand-green);
  --green-dark: #268a3e;
  --green-muted: rgba(45, 156, 72, 0.12);
  --green-text: var(--brand-green);
  --white: #ffffff;
  --gray-100: #f2f4f8;
  --gray-200: #e2e6ee;
  --gray-300: #d1d9e6;
  --gray-400: #94a3b8;
  --gray-600: #5b6b7c;
  --text: #152033;
  --page-bg: var(--brand-navy);
  --login-pattern-h: #1E1C54;
  --shell-radius: 16px;
  --shell-padding: 12px;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 72px;
  --bp-phone: 720px;
  --bp-tablet: 1200px;
  --card-radius: 12px;
  --shadow-card: 0 1px 2px rgba(25, 24, 71, 0.06), 0 4px 14px rgba(25, 24, 71, 0.05);
  --shadow-shell: 0 12px 48px rgba(25, 24, 71, 0.22);
  --panel-width: 280px;
  --filter-bg: #eef0f4;

  /* Design-system tokens — also set by theme.js */
  --ds-surface: #ffffff;
  --ds-surface-muted: #f2f4f8;
  --ds-border: #e2e6ee;
  --ds-text-muted: #5b6b7c;
  --ds-card-gap: 14px;
  --ds-content-pad: 20px;

  --scrollbar-size: 8px;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(25, 24, 71, 0.22);
  --scrollbar-thumb-hover: rgba(45, 156, 72, 0.55);

  --font-heading: 'Roboto', system-ui, sans-serif;
  --font-body: 'Roboto', system-ui, sans-serif;
  --font-size-tiny: 10px;
  --font-size-regular: 12px;
  --font-size-subtitle: 14px;
  --font-size-title: 20px;
  --font-size-huge: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

html, body, #root {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--primary-1);
  color: var(--text);
  font-size: var(--font-size-subtitle);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .page-title, .login-logo, .kpi-value, .kpi-card-v2-value {
  font-family: var(--font-heading);
}

.ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  vertical-align: middle;
}

.ui-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ui-icon i {
  display: block;
  line-height: 1;
}

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  width: 100%;
  background-color: var(--primary-1);
  padding: var(--shell-padding);
  gap: 0;
  align-items: stretch;
  position: relative;
  transition: padding 0.22s ease;
}

.app-shell::before,
.login-screen::before {
  /* 45% scale +10% size; +10% spacing via padded tile. BG #191847 / h #1E1C54 */
  --login-h-tile: calc(38.5px * 0.45 * 1.7);
  --login-h-ox: calc(var(--login-h-tile) / 2);
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--login-pattern-h);
  opacity: 0.45;
  -webkit-mask-image: url('/images/pattern-h.svg'), url('/images/pattern-h.svg');
  mask-image: url('/images/pattern-h.svg'), url('/images/pattern-h.svg');
  -webkit-mask-size: var(--login-h-tile) var(--login-h-tile), var(--login-h-tile) var(--login-h-tile);
  mask-size: var(--login-h-tile) var(--login-h-tile), var(--login-h-tile) var(--login-h-tile);
  -webkit-mask-position: 0 0, var(--login-h-ox) var(--login-h-ox);
  mask-position: 0 0, var(--login-h-ox) var(--login-h-ox);
  -webkit-mask-repeat: repeat, repeat;
  mask-repeat: repeat, repeat;
  pointer-events: none;
}

.app-panel {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--ds-surface-muted);
  border-radius: var(--shell-radius);
  box-shadow: var(--shadow-shell);
  overflow: hidden;
  transition: box-shadow 0.22s ease;
  position: relative;
  z-index: 1;
}

.app-panel > .sidebar-wrap {
  position: relative;
  flex-shrink: 0;
  width: var(--sidebar-width);
  transition: width 0.22s ease;
  z-index: 30;
  overflow: visible;
}

.app-panel > .sidebar-wrap > .sidebar {
  border-radius: 0;
  border: none;
  box-shadow: none;
  width: 100%;
}

.app-panel > .main {
  flex: 1;
  min-width: 0;
  background: var(--white);
  border-radius: 0;
  border: none;
  box-shadow: none;
  overflow: hidden;
  height: auto;
}

.app-shell.sidebar-collapsed {
  --sidebar-width: var(--sidebar-collapsed-width);
}

.nav-backdrop {
  display: none;
}

.header-consultor-meter {
  display: none;
}

.header-consultor-meter .header-consultor-frame {
  width: 48px;
  height: 48px;
}

.header-consultor-meter .user-avatar {
  width: 36px;
  height: 36px;
}

.header-consultor-meter .user-avatar-inset {
  width: 32px;
  height: 32px;
}

.header-consultor-meter .user-escalao-chip {
  width: 16px;
  height: 16px;
  font-size: 0.5625rem;
  border-width: 1.5px;
  transform: translate(-50%, 28%);
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

/* Phone: off-canvas nav drawer */
@media (max-width: 720px) {
  .app-shell {
    --shell-padding: 0;
    --shell-radius: 0;
    padding: 0;
  }

  .app-panel {
    border-radius: 0;
    box-shadow: none;
  }

  .app-panel > .sidebar-wrap {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 86vw) !important;
    max-width: 280px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 220;
    box-shadow: none;
  }

  .app-shell.nav-open .app-panel > .sidebar-wrap {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(25, 24, 71, 0.28);
    z-index: 220;
    pointer-events: auto;
  }

  .app-panel > .sidebar-wrap::after {
    display: none;
  }

  .app-shell[data-viewport="phone"] .sidebar-collapse-btn {
    display: none;
  }

  .nav-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(25, 24, 71, 0.45);
    z-index: 210;
    pointer-events: auto;
  }

  .app-shell[data-viewport="phone"] .topbar-module .page-title {
    font-size: 1.25rem;
  }

  .app-shell[data-viewport="phone"] .page-title-icon {
    width: 2.25rem;
    height: 2.25rem;
  }
}

/* Tablet: denser shell, icon rail already via sidebar-collapsed */
@media (min-width: 721px) and (max-width: 1199px) {
  .app-shell {
    --shell-padding: 8px;
  }
}

/* ── Sidebar (Power Apps white) ── */
.sidebar {
  width: 100%;
  background: var(--white);
  color: var(--navy);
  display: flex;
  flex-direction: column;
  padding: 15px 10px 15px 0;
  flex-shrink: 0;
  height: 100%;
  border: none;
  position: relative;
  transition: width 0.22s ease;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 20;
}

.app-panel > .sidebar-wrap::after {
  content: '';
  position: absolute;
  top: 2.5rem;
  right: 0;
  bottom: 2.5rem;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--gray-300) 12%,
    var(--gray-400) 35%,
    var(--gray-400) 65%,
    var(--gray-300) 88%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 25;
}

.sidebar-collapse-btn {
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(25, 24, 71, 0.12);
  transition: background 0.15s, box-shadow 0.15s, transform 0.22s ease;
  padding: 0;
  line-height: 0;
  font-size: 12px;
}

.sidebar-collapse-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  line-height: 1;
  pointer-events: none;
}

.sidebar-collapse-btn i::before {
  display: block;
  line-height: 1;
}

.sidebar-collapse-btn:hover {
  background: var(--gray-100);
  box-shadow: 0 4px 12px rgba(25, 24, 71, 0.16);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem 1rem;
  line-height: 0;
}

.brand-logo-sidebar {
  display: block;
  width: auto;
  max-width: 160px;
  height: auto;
  max-height: 56px;
  margin: 0 auto;
  object-fit: contain;
}

.sidebar.collapsed .logo {
  padding: 0.5rem 0.25rem 1rem;
  text-align: center;
}

.sidebar.collapsed .brand-logo-sidebar {
  max-width: 52px;
  max-height: 52px;
}

.brand-logo-himo-footer {
  display: block;
  width: auto;
  max-width: 96px;
  height: auto;
  max-height: 32px;
  margin: 0 auto;
  object-fit: contain;
}

.sidebar.collapsed .brand-logo-himo-footer {
  max-width: 52px;
  max-height: 24px;
}

.login-logo-img.brand-logo {
  display: block;
  width: auto;
  max-width: 240px;
  height: auto;
  margin: 0 auto 1.5rem;
  object-fit: contain;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--gray-600);
}

.loading-spinner-full {
  min-height: 100vh;
  background: var(--gray-100);
}

.loading-spinner-gif {
  width: 72px;
  height: auto;
  display: block;
}

.loading-spinner-text {
  margin: 0;
  font-size: 0.8125rem;
}

.site-connection-title-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.site-connection-logo {
  height: 28px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-connection-logo.brand-logo-himo {
  background: #000;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  height: 32px;
}

.login-brands {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1;
}

.login-brand-logo-himo {
  height: 36px;
  width: auto;
}

.login-brand-logo-habita {
  height: 32px;
  width: auto;
  opacity: 0.92;
}

.logo-my {
  color: var(--green);
  font-size: 0.625rem;
  font-weight: 600;
  display: block;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.sidebar.collapsed .logo-my,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role-line,
.sidebar.collapsed .view-as-exit-btn,
.sidebar.collapsed .connection-badge {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.user-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem 0.875rem;
  overflow: visible;
}

.user-block-livia {
  padding-top: 1rem;
}

.user-block-collapsed {
  padding: 0.5rem 0.25rem 0.75rem;
}

.user-avatar-stack {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  overflow: visible;
}

.user-avatar-tip-wrap {
  position: relative;
  display: inline-flex;
}

.user-avatar-frame {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

button.user-avatar-frame {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

button.user-avatar-frame.is-clickable:hover .user-avatar,
button.user-avatar-frame.is-clickable:focus-visible .user-avatar {
  box-shadow: 0 0 0 3px rgba(45, 156, 72, 0.35);
}

button.user-avatar-frame.is-clickable:focus-visible {
  outline: none;
}

.user-block-collapsed .user-avatar-frame {
  width: 44px;
  height: 44px;
}

.user-avatar-frame.has-ring .commission-ring-svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  pointer-events: none;
  z-index: 0;
}

.user-commission-tip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: min(260px, 70vw);
  pointer-events: none;
  animation: commission-tip-in 0.18s ease;
}

.user-commission-tip.is-portal {
  position: fixed;
  z-index: 10050;
  margin: 0;
}

.user-commission-tip.is-portal.place-right {
  left: auto;
  top: auto;
  transform: translateY(-50%);
  animation: commission-tip-in 0.18s ease;
}

.user-commission-tip.is-portal.place-below {
  left: auto;
  top: auto;
  transform: translateX(-50%);
  animation: commission-tip-in-collapsed 0.18s ease;
}

.user-block-collapsed .user-commission-tip:not(.is-portal) {
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  animation: commission-tip-in-collapsed 0.18s ease;
}

@keyframes commission-tip-in {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@keyframes commission-tip-in-collapsed {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gray-200);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--navy);
  overflow: hidden;
}

.user-avatar-inset {
  position: relative;
  z-index: 1;
  width: 54px;
  height: 54px;
  border-width: 1px;
}

.user-block-collapsed .user-avatar {
  width: 40px;
  height: 40px;
}

.user-block-collapsed .user-avatar-inset {
  width: 34px;
  height: 34px;
}

.user-block-livia .user-avatar-stack {
  margin-bottom: 0.15rem;
  padding-top: 0.15rem;
}

.user-avatar-frame.has-fun-mask .user-avatar {
  width: 72px;
  height: 72px;
}

.user-block-collapsed .user-avatar-frame.has-fun-mask .user-avatar {
  width: 42px;
  height: 42px;
}

.user-avatar-fun-mask {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  z-index: 4;
  user-select: none;
}

.user-block-collapsed .user-avatar-fun-mask {
  width: 100%;
  height: 100%;
}

.user-sigla {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.user-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-name {
  font-weight: 700;
  font-size: 0.6875rem;
  line-height: 1.25;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--navy);
  padding: 0 0.25rem;
}

button.user-name-btn {
  border: none;
  background: transparent;
  margin: 0;
  font: inherit;
  font-weight: 700;
  font-size: 0.6875rem;
  line-height: 1.25;
  cursor: pointer;
  text-align: center;
}

button.user-name-btn:hover,
button.user-name-btn:focus-visible {
  color: var(--primary-2, #2d9c48);
  text-decoration: underline;
  outline: none;
}

.user-role-line {
  font-size: 0.75rem;
  color: var(--gray-600);
  line-height: 1.3;
}

.escalao-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.escalao-badge-num {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--navy);
  min-width: 0.75rem;
}

/* Circular escalão chip sitting in the ring gap at the bottom of the avatar */
.user-escalao-chip {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 35%);
  z-index: 5;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--navy, #191847);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(25, 24, 71, 0.28);
  pointer-events: none;
}

.user-block-collapsed .user-escalao-chip {
  width: 16px;
  height: 16px;
  font-size: 0.5625rem;
  border-width: 1.5px;
  transform: translate(-50%, 30%);
}

.user-avatar-frame.has-fun-mask .user-escalao-chip {
  bottom: 2px;
}

.view-as-exit-btn {
  margin-top: 0.35rem;
  border: none;
  background: var(--green-muted);
  color: var(--navy);
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
}

.view-as-exit-btn:hover {
  background: var(--green);
  color: var(--white);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-200);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
  color: var(--gray-600);
}

.user-info { min-width: 0; flex: 1; }

.connection-badge {
  display: inline-block;
  font-size: 0.625rem;
  margin-top: 0.25rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--gray-100);
}

.connection-badge.live { color: var(--green-dark); }
.connection-badge.offline { color: var(--gray-400); }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem 0.625rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  color: var(--navy);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  border-left: 3px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0.5rem;
  gap: 0;
  /* Avoid left-border offset so the icon stays visually centered */
  border-left-width: 0;
}

.sidebar.collapsed .nav-label {
  display: none;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  opacity: 0.88;
  transition: transform 0.2s ease, color 0.12s, opacity 0.12s;
}

.nav-icon .ui-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.nav-item.active .nav-icon {
  color: var(--accent);
  opacity: 1;
  animation: nav-icon-pop 0.35s ease;
}

.nav-item.active .nav-icon .ui-icon {
  animation: nav-icon-pop 0.35s ease;
}

.nav-item:hover:not(.disabled) .nav-icon,
.nav-item:hover:not(.disabled) .nav-icon .ui-icon {
  transform: scale(1.08);
  opacity: 1;
}

@keyframes nav-icon-pop {
  0% { transform: scale(0.85); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.nav-item.disabled .nav-icon {
  color: var(--gray-400);
  opacity: 1;
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s;
}

.nav-item:hover:not(.disabled) {
  background: var(--ds-surface-muted);
}

.nav-item.active {
  background: var(--green-muted);
  border-left-color: var(--accent);
  color: var(--brand-navy);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(45, 156, 72, 0.08);
}

.nav-item.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.settings-btn {
  padding: 0.375rem;
  margin-top: auto;
}

.nav-item-settings { color: var(--gray-600); font-size: 0.75rem; }
.nav-item-logout { color: var(--gray-600); font-size: 0.75rem; }

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  background: var(--ds-surface-muted);
}

.page-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.page-content {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Topbar ── */
.topbar {
  background: var(--ds-surface);
  padding: 0.75rem var(--ds-content-pad);
  border-bottom: 1px solid var(--ds-border);
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

/* Module page header — transparent over patterned main */
.topbar-module,
.topbar.topbar-module {
  align-items: center;
  background: transparent;
  border: none;
  border-bottom: none;
  box-shadow: none;
  padding: 1.25rem var(--ds-content-pad) 0.75rem;
  min-height: 0;
}

.topbar-module .topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  min-width: 0;
}

.topbar-module .topbar-actions {
  align-items: center;
  gap: 0.5rem;
  padding-top: 0;
}

.topbar-module .page-title {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0;
  color: var(--brand-navy);
}

.topbar-module .page-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: var(--green-muted);
  color: var(--green, var(--primary-2, #2D9C48));
  flex-shrink: 0;
}

.topbar-module .page-title-icon .fa-icon,
.topbar-module .page-title-icon i {
  font-size: 1.15rem;
  line-height: 1;
}

/* Pill actions in module topbars (match dashboard year/date chips) */
.topbar-module .topbar-actions .btn,
.dashboard-header-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  min-height: 2rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
}

.topbar-module .topbar-actions .btn-secondary,
.dashboard-header-actions .btn-secondary {
  background: var(--ds-surface, #fff);
  color: var(--brand-navy);
  border: 1px solid var(--ds-border, var(--gray-200));
  box-shadow: none;
}

.topbar-module .topbar-actions .btn-secondary:hover,
.dashboard-header-actions .btn-secondary:hover {
  background: var(--ds-surface-muted, var(--gray-100));
  border-color: var(--gray-300);
}

.topbar-module .topbar-actions .btn-primary,
.dashboard-header-actions .btn-primary {
  border: none;
}

.topbar-module .topbar-actions .btn-icon-ghost,
.dashboard-header-actions .btn-icon-ghost {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
}

.topbar-dashboard {
  align-items: center;
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-border);
  padding: 0.875rem var(--ds-content-pad);
}

.topbar-greeting {
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border-bottom: none;
  padding: 1.15rem var(--ds-content-pad) 0.85rem;
}

/* Dashboard greeting sits on the patterned page — never opaque */
.topbar.topbar-dashboard.topbar-greeting {
  background: transparent;
  border: none;
  border-bottom: none;
  box-shadow: none;
}

.topbar-dashboard .topbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--ds-surface-muted, var(--gray-100));
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: 999px;
  color: var(--gray-600);
  font-size: 0.8125rem;
  min-width: 200px;
  max-width: 280px;
}

.topbar-dashboard .topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--text);
}

.topbar-dashboard .topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.btn-icon-ghost {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}

.btn-icon-ghost:hover {
  background: var(--gray-100);
  color: var(--navy);
}

.btn-icon-ghost.danger:hover {
  background: rgba(193, 60, 60, 0.12);
  color: var(--error);
}

.data-table .col-acoes {
  width: 120px;
  min-width: 120px;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
}

.data-table .row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.data-grid-table td.col-acoes {
  overflow: visible;
}

.consultor-search {
  position: relative;
  width: 100%;
}

.consultor-search-input-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.consultor-search-input-row input {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.consultor-search-clear {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--gray-600, #6b7280);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.consultor-search-clear:hover {
  background: var(--gray-100, #f3f4f6);
  color: var(--navy, #0f2744);
}

.consultor-search-selected {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--navy, #0f2744);
  font-weight: 600;
}

.consultor-search-hint {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--gray-600, #6b7280);
}

.list-totals-footer {
  font-size: 0.8125rem;
  color: var(--navy, #0f2744);
  font-weight: 600;
}

/* Compact dashboard stat cards (match kpi-card-v2 label scale) */
.dash-stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.dash-stat-card-head {
  box-sizing: border-box;
  /* Must clear the absolutely positioned .kpi-card-v2-icon (same top/size clamps) */
  min-height: calc(clamp(0.5rem, 4cqi, 1.125rem) + clamp(28px, 10cqi, 36px) + 0.4rem);
  padding: 0.75rem var(--ds-content-pad, 1.125rem) 0.35rem;
  padding-right: 3.25rem;
  flex-shrink: 0;
}

@container kpi-card (max-width: 170px) {
  .dash-stat-card-head {
    min-height: calc(0.5rem + 28px + 0.4rem);
  }
}

.dash-stat-card-head .kpi-card-v2-label {
  font-size: clamp(0.58rem, 0.46rem + 1.1cqi + 0.55cqh, 0.78rem);
  text-align: left;
}

.dash-stat-card-body {
  padding: 0 var(--ds-content-pad, 1.125rem) 0.85rem;
  min-height: 0;
  overflow: auto;
}

.dash-bars-card .dash-stat-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dash-bars-card .dash-stat-card-body .dash-stat-hero,
.dash-bars-card .dash-stat-card-body .dash-stat-meta {
  flex: 0 0 auto;
}

.dash-bars-card .dash-stat-card-body .dash-bars {
  flex: 1;
  padding: 0.4rem 0 0;
  overflow: hidden;
}

.dash-stat-hero {
  text-align: left;
  font-size: clamp(1rem, 4.5cqi, 1.35rem) !important;
  margin: 0 0 0.25rem;
}

.dash-stat-meta,
.dash-stat-consultor {
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--ds-text-muted, var(--gray-600));
  font-weight: 500;
}

.dash-stat-consultor {
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--brand-navy, #0f2744);
}

.dash-stat-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 var(--ds-content-pad, 1.125rem) 0.85rem;
  min-height: 0;
  overflow: auto;
}

.dash-stat-rows--tight {
  padding: 0;
  gap: 0.25rem;
}

.dash-stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.5rem 0.65rem;
  align-items: center;
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--brand-navy, #0f2744);
}

.dash-stat-label {
  font-weight: 500;
  color: var(--ds-text-muted, var(--gray-600));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-stat-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.8125rem;
  text-align: right;
}

.dash-stat-money {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--brand-navy, #0f2744);
  min-width: 4.5rem;
}

.dash-stat-money--muted {
  color: var(--ds-text-muted, var(--gray-600));
  font-weight: 500;
}

.dash-stat-card .status-badge {
  font-size: 0.625rem;
  padding: 0.15rem 0.4rem;
}

.dashboard-estado-buckets {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0 1.125rem 1rem;
}

.dashboard-estado-bucket-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8125rem;
}

.dashboard-estado-bucket-row .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 5.5rem;
}

.consultor-search input {
  width: 100%;
}

.consultor-search-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.consultor-search-menu-portal {
  z-index: 13000 !important;
  overflow-y: auto;
}

.consultor-search-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--navy, #0f2744);
}

.consultor-search-option:hover,
.consultor-search-option:focus {
  background: var(--gray-100, #f3f4f6);
}

.consultor-search-option strong {
  font-size: 0.875rem;
  font-weight: 600;
}

.consultor-search-option span {
  font-size: 0.75rem;
  color: var(--gray-600, #6b7280);
}

.consultor-search-empty {
  padding: 0.75rem;
  font-size: 0.8125rem;
  color: var(--gray-600, #6b7280);
}

.mediacao-toolbar .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.topbar-dashboard .page-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
}

.topbar-module .greeting-subtitle {
  color: var(--ds-text-muted);
  font-size: 0.8125rem;
  font-weight: 400;
  margin-bottom: 0;
  margin-top: 0.375rem;
}

.topbar-dashboard .topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0;
}

.topbar-left { min-width: 0; }

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.greeting {
  color: var(--green-text);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.greeting-green { color: var(--primary-2); }

.page-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.025em;
}

.page-title-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--primary-1);
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  white-space: nowrap;
}

.action-pill:hover {
  border-color: var(--green);
  background: var(--gray-100);
}

.btn-filter-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gray-300);
  background: var(--white);
  cursor: pointer;
  font-size: 1rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-filter-toggle.active,
.btn-filter-toggle:hover {
  border-color: var(--green);
  background: var(--green-muted);
  color: var(--green-dark);
}

.btn-filter-chart {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  overflow: visible;
}

.content {
  flex: 1;
  padding: 0.75rem 1rem;
  overflow: visible;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  min-height: 0;
}

.page-content .content,
.page-content.module-layout,
.page-content.mediacao-layout {
  padding: 20px;
  flex-direction: column;
  align-items: stretch;
  background: transparent;
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

/* H pattern behind ModuleTopbar + page content (Mediação / module pages) */
.app-panel > .main:has(.mediacao-layout),
.app-panel > .main:has(.module-layout),
.main:has(.mediacao-layout),
.main:has(.module-layout) {
  --dashboard-h-tile: calc(38.5px * 0.45 * 1.7);
  --dashboard-h-ox: calc(var(--dashboard-h-tile) / 2);
  --dashboard-pattern-h: #efefef;
  background: var(--ds-surface-muted, #efefef);
  position: relative;
  isolation: isolate;
}

.app-panel > .main:has(.mediacao-layout)::before,
.app-panel > .main:has(.module-layout)::before,
.main:has(.mediacao-layout)::before,
.main:has(.module-layout)::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--dashboard-pattern-h);
  -webkit-mask-image: url('/images/pattern-h.svg'), url('/images/pattern-h.svg');
  mask-image: url('/images/pattern-h.svg'), url('/images/pattern-h.svg');
  -webkit-mask-size: var(--dashboard-h-tile) var(--dashboard-h-tile), var(--dashboard-h-tile) var(--dashboard-h-tile);
  mask-size: var(--dashboard-h-tile) var(--dashboard-h-tile), var(--dashboard-h-tile) var(--dashboard-h-tile);
  -webkit-mask-position: 0 0, var(--dashboard-h-ox) var(--dashboard-h-ox);
  mask-position: 0 0, var(--dashboard-h-ox) var(--dashboard-h-ox);
  -webkit-mask-repeat: repeat, repeat;
  mask-repeat: repeat, repeat;
  pointer-events: none;
}

.app-panel > .main:has(.mediacao-layout) > *,
.app-panel > .main:has(.module-layout) > *,
.main:has(.mediacao-layout) > *,
.main:has(.module-layout) > * {
  position: relative;
  z-index: 1;
}

/* Keep dialogs floating over the viewport — the rule above would otherwise
   force position:relative and drop the panel to the bottom of main. */
.app-panel > .main:has(.mediacao-layout) > .negocio-modal-overlay,
.app-panel > .main:has(.module-layout) > .negocio-modal-overlay,
.main:has(.mediacao-layout) > .negocio-modal-overlay,
.main:has(.module-layout) > .negocio-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
}

.page-content.mediacao-layout,
.page-content.module-layout {
  position: relative;
  isolation: isolate;
}

.page-content.mediacao-layout::before {
  display: none;
}

.page-body:has(.module-layout),
.page-body:has(.mediacao-layout) {
  background: transparent;
}

.mediacao-layout .content-main,
.module-layout .content-main {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  flex: 1;
}

/* Tabs passed into ModulePageShell must not nest an extra module-card */
.module-page-shell-tabs .module-card,
.module-page-shell-tabs .module-card-tabs {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.equipa-layout .module-page-shell-body {
  gap: 0.45rem;
}

.equipa-layout .equipa-location-rail {
  margin-top: 0;
  flex-shrink: 0;
}

.equipa-layout .equipa-cards {
  flex: 1;
  min-height: 0;
}

.equipa-layout .equipa-grid {
  flex: 1;
  min-height: 0;
}

.page-content.dashboard-layout {
  padding: var(--ds-content-pad, 20px);
  flex-direction: column;
  align-items: stretch;
  display: flex;
  flex: 1;
  min-height: 0;
  gap: var(--ds-card-gap, 0.875rem);
  background: var(--ds-surface-muted, var(--gray-100));
}

.page-body:has(.dashboard-layout) {
  background: var(--ds-surface-muted, var(--gray-100));
}

.content-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ── Tabs (Power Apps underline) ── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0.875rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
  border-radius: 8px 8px 0 0;
  padding: 0 0.5rem;
}

.tab {
  padding: 0.625rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--gray-600);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.tab:hover:not(:disabled) { color: var(--navy); }

.tab.active {
  color: var(--navy);
  border-bottom-color: var(--green);
  font-weight: 600;
}

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

/* ── Toolbar ── */
.toolbar {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: stretch;
  background: var(--white);
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.toolbar-filters,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

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

.toolbar-actions > .btn,
.toolbar-filters > .btn {
  flex: 0 1 auto;
  min-width: 0;
}

.toolbar-filters:empty,
.toolbar-actions:empty {
  display: none;
}

.toolbar input,
.toolbar select {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--ds-border, var(--gray-300));
  border-radius: 999px;
  font-size: 0.8125rem;
  background: var(--ds-surface, var(--white));
  color: var(--text, var(--navy));
  min-height: 2rem;
}

.toolbar input { min-width: 160px; }

.toolbar input:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green-muted);
}

.module-page-shell-toolbar .btn,
.mediacao-toolbar .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  min-height: 2rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--green-muted);
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
  background: var(--ds-surface);
  color: var(--brand-navy);
  border-color: var(--ds-border);
  box-shadow: 0 1px 0 rgba(25, 24, 71, 0.03);
}
.btn-secondary:hover {
  background: var(--ds-surface-muted);
  border-color: var(--gray-300);
}
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-danger { background: var(--color-error); color: var(--white); border-color: var(--color-error); }

.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.confirm-dialog {
  width: min(420px, 100%);
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 1.25rem 1.35rem 1.15rem;
}

.confirm-dialog h3 {
  margin: 0 0 0.5rem;
  color: var(--navy);
  font-size: 1.05rem;
}

.confirm-dialog p {
  margin: 0;
  color: var(--gray-600);
  font-size: 0.875rem;
  line-height: 1.45;
}

.confirm-dialog p strong {
  color: var(--navy);
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.confirm-dialog-actions .btn,
.confirm-dialog-choice-list .btn {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.confirm-dialog-actions .btn-danger:hover {
  filter: brightness(0.95);
}

.confirm-dialog-choices {
  width: min(440px, 100%);
}

.confirm-dialog-choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.confirm-dialog-choice-list .btn {
  width: 100%;
}

.confirm-dialog-hint {
  margin: 0.9rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--gray-600);
}
.btn-icon { padding: 0.45rem 0.55rem; min-width: 2.25rem; }

/* ── Data table (dense) ── */
.data-table-wrap {
  background: var(--ds-surface);
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--ds-border);
  box-shadow: var(--shadow-card);
}

.data-table-wrap.data-grid-scroll {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.data-grid-table.data-grid-table-autofit,
table.data-grid-table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.data-grid-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overflow-x: auto;
}

.data-grid-table th,
.data-grid-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.data-grid-table th.col-acoes,
.data-grid-table td.col-acoes {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table th {
  background: var(--ds-surface-muted);
  color: var(--brand-navy);
  text-align: left;
  padding: 0.55rem 0.625rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--ds-border);
  box-shadow: 0 1px 0 rgba(25, 24, 71, 0.04);
}

.data-table td {
  padding: 0.375rem 0.625rem;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}

.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:nth-child(even) td { background: #fafbfc; }
.data-table tbody tr:hover td { background: #f0f4f8; }
.data-table tbody tr.selected td { background: #ecfccb !important; }

.status-badge {
  display: inline-block;
  padding: 0.125rem 0.4rem;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-concluido { background: var(--tone-concluido-bg); color: var(--tone-concluido-fg); }
.status-em-curso { background: var(--tone-em-curso-bg); color: var(--tone-em-curso-fg); }
.status-perdido { background: var(--tone-perdido-bg); color: var(--tone-perdido-fg); }
.status-venda { background: var(--tone-venda-bg); color: var(--tone-venda-fg); }
.status-arrendamento { background: var(--tone-arrendamento-bg); color: var(--tone-arrendamento-fg); }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.75rem;
  color: var(--gray-600);
  background: #f3f4f6;
}

.pagination > span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination .ui-tooltip-host {
  width: auto;
}

/* ── Side panels (Filtros / Atualizar) ── */
.side-panel {
  width: 100%;
  background: var(--white);
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 0;
  flex-shrink: 0;
  max-height: none;
  overflow-y: auto;
}

.side-panel.filtros {
  border-top: 3px solid var(--green);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}

.panel-header-icon { font-size: 0.875rem; }

.panel-header h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  padding: 0;
  border: none;
}

.panel-ref {
  font-weight: 400;
  color: var(--gray-600);
  font-size: 0.8125rem;
}

.side-panel .form-group {
  padding: 0 1rem;
}

.side-panel .form-group:first-of-type { margin-top: 0.75rem; }

.side-panel .btn-primary {
  margin: 0.5rem 1rem 1rem;
  width: calc(100% - 2rem);
}

.update-panel .panel-actions {
  margin: 0 1rem 1rem;
}

.form-group {
  margin-bottom: 0.75rem;
}

.form-group label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  min-height: 2.375rem;
  border: 1px solid var(--ds-border, var(--gray-300));
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--ds-surface);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-muted);
}

.app-select {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.app-select-label {
  color: var(--gray-600);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.app-select-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  margin: 0;
  border: 1px solid var(--ds-border, var(--gray-300));
  outline: none;
  background-color: var(--ds-surface, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23191847' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 12px;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border-radius: 8px;
  color: var(--brand-navy, var(--navy, #1F2C5C));
  font: inherit;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  min-height: 2.375rem;
  min-width: 4.5rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.app-select-trigger strong {
  font: inherit;
  font-weight: 700;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-select-trigger .app-select-placeholder {
  font-weight: 600;
  color: var(--gray-500);
}
.app-select-trigger:hover:not(:disabled) {
  border-color: rgba(45, 156, 72, 0.45);
  background-color: rgba(45, 156, 72, 0.04);
}
.app-select-trigger.is-open,
.app-select-trigger:focus-visible {
  border-color: var(--accent, #2D9C48);
  box-shadow: 0 0 0 3px rgba(45, 156, 72, 0.16);
}
.app-select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.app-select-field,
.form-group .app-select,
.form-group .app-select-field {
  display: block;
  width: 100%;
}
.app-select-field .app-select-trigger,
.form-group .app-select .app-select-trigger {
  width: 100%;
}
.app-select-pill,
.dashboard-year-filter.app-select-pill,
.app-select-toolbar,
.app-select-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--brand-navy, var(--navy));
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: none;
}
.app-select-pill .app-select-trigger,
.app-select-toolbar .app-select-trigger,
.app-select-compact .app-select-trigger {
  min-height: 2rem;
  min-width: 4.25rem;
  padding: 0.3rem 1.7rem 0.3rem 0.55rem;
  font-size: 0.8125rem;
  background-position: right 0.55rem center;
}
.toolbar .app-select-toolbar,
.toolbar-filters .app-select {
  flex: 0 1 auto;
}
.app-select-popover {
  z-index: 13000;
}
.app-select-list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.app-select-opt.is-row {
  width: 100%;
  justify-content: flex-start;
  white-space: nowrap;
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
}
.app-select-popover.is-list .chart-filter-popover-body {
  padding: 0.4rem;
  gap: 0;
}
.app-select-opt.is-on {
  border-color: var(--green, #2D9C48);
  background: rgba(45, 156, 72, 0.1);
  box-shadow: inset 3px 0 0 var(--green, #2D9C48);
}

.app-select-combo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  width: 100%;
}
.app-select-combo .app-select-label {
  color: var(--brand-navy, var(--navy, #1F2C5C));
  font-size: 0.875rem;
  font-weight: 650;
}
.app-select-combo .app-select-trigger {
  width: 100%;
  font-weight: 500;
  cursor: text;
}
.app-select-combo input.app-select-trigger {
  cursor: text;
}
.app-select-combo input.app-select-trigger::placeholder {
  color: var(--gray-400, #94a3b8);
  font-weight: 500;
  opacity: 1;
}
.app-select-combo .app-select-trigger strong {
  font-weight: 500;
}
.app-select-combo.is-open .app-select-trigger,
.app-select-listbox.is-open .app-select-trigger {
  border-radius: 8px 8px 0 0;
  border-bottom-color: transparent;
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 7.5L6 4.5L9 7.5' stroke='%23191847' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.app-select-combo.is-open.is-flip .app-select-trigger,
.app-select-listbox.is-open.is-flip .app-select-trigger {
  border-radius: 0 0 8px 8px;
  border-bottom-color: var(--ds-border, var(--gray-300));
  border-top-color: transparent;
}
.app-select-popover.is-combo,
.app-select-popover.is-list {
  width: auto;
  min-width: 0;
  max-height: min(360px, calc(100vh - 24px));
  border-radius: 0 0 8px 8px;
  border-top: none;
  box-shadow: 0 16px 32px rgba(25, 24, 71, 0.12);
}
.app-select-popover.is-combo.is-flip,
.app-select-popover.is-list.is-flip {
  border-radius: 8px 8px 0 0;
  border-top: 1px solid var(--ds-border, var(--gray-200));
  border-bottom: none;
}
.app-select-popover.is-combo .chart-filter-popover-body {
  padding: 0.55rem 0.55rem 0.65rem;
  gap: 0;
}
.app-select-combo-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.app-select-combo-opt {
  appearance: none;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.65rem 0.9rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--brand-navy, var(--navy, #1F2C5C));
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
.app-select-combo-opt:hover:not(:disabled) {
  background: var(--ds-surface-muted, var(--gray-100));
}
.app-select-combo-opt.is-on {
  background: var(--ds-surface-muted, var(--gray-100));
}
.app-select-combo-opt.is-active {
  background: var(--ds-surface-muted, var(--gray-100));
}
.app-select-combo-opt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.app-select-combo-empty {
  padding: 0.7rem 0.9rem;
  color: var(--ds-text-muted, var(--gray-600));
  font-size: 0.875rem;
  font-weight: 500;
}
.data-grid-col-menu .app-select,
.data-grid-col-menu .app-select-trigger {
  width: 100%;
}
.data-grid-col-menu .app-select {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  min-width: 0;
}
.data-grid-col-menu .app-select-compact {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.phone-card-mapper .app-select-trigger {
  width: 100%;
  min-height: 32px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--gray-600);
  border-style: dashed;
  background-color: var(--gray-100, #f3f4f6);
}
.perfil-card-head-row .app-select-compact .app-select-trigger {
  min-width: 5.5rem;
  height: 32px;
  min-height: 32px;
}

.date-picker {
  width: 100%;
}

.date-picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  min-height: 2.375rem;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.date-picker.is-open .date-picker-trigger,
.date-picker-trigger:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-muted);
}

.date-picker.is-disabled .date-picker-trigger {
  opacity: 0.6;
  cursor: not-allowed;
}

.date-picker-placeholder {
  color: var(--gray-400);
}

.date-picker-value {
  color: var(--navy);
  font-weight: 500;
}

.date-picker-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gray-600);
  flex-shrink: 0;
}

.date-picker-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-600);
}

.date-picker-clear:hover {
  background: var(--gray-200);
  color: var(--navy);
}

.date-picker-panel {
  position: fixed;
  z-index: 1600;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  padding: 0.75rem;
}

.date-picker-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.date-picker-month-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  color: var(--navy);
}

.date-picker-month-label strong {
  font-size: 0.9375rem;
}

.date-picker-month-label span {
  font-size: 0.75rem;
  color: var(--gray-600);
}

.date-picker-selectors {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.date-picker-select-wrap {
  margin: 0;
  min-width: 0;
}
.date-picker-select-wrap .app-select,
.date-picker-selectors .app-select {
  min-width: 0;
}
.date-picker-select-wrap .app-select-trigger {
  min-height: 2rem;
  padding: 0.3rem 1.6rem 0.3rem 0.5rem;
  font-size: 0.8125rem;
}

.date-picker-select-month {
  width: 7.5rem;
}

.date-picker-select-year {
  width: 4.75rem;
}

.date-picker-select-month .app-select-trigger,
.date-picker-select-year .app-select-trigger {
  width: 100%;
}

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

.date-picker-nav-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-100);
  color: var(--navy);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.date-picker-nav-btn:hover {
  background: var(--green-muted);
  border-color: rgba(45, 156, 72, 0.35);
}

.date-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
  margin-bottom: 0.35rem;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}

.date-picker-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--navy);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.date-picker-day.is-empty {
  pointer-events: none;
}

.date-picker-day:hover:not(.is-empty):not(:disabled) {
  background: var(--green-muted);
}
.date-picker-day:disabled,
.date-picker-day.is-disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

.date-picker-day.is-today {
  box-shadow: inset 0 0 0 1.5px var(--green);
}

.date-picker-day.is-selected {
  background: var(--green);
  color: #fff;
  box-shadow: none;
}

.date-picker-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--gray-200);
}

.time-picker-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.time-picker-col-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

.time-picker-list {
  max-height: 12rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.25rem;
}

.time-picker-opt {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.time-picker-opt:hover:not(:disabled) {
  background: var(--green-muted);
}

.time-picker-opt.is-selected {
  background: var(--green);
  color: #fff;
}

.time-picker-opt:disabled,
.time-picker-opt.is-disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

.radio-group { display: flex; flex-direction: column; gap: 0.375rem; }

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 400;
  text-transform: none;
  color: var(--text);
  cursor: pointer;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200);
}

/* ── Module placeholder / disabled ── */
.module-placeholder {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--gray-600);
}

.module-placeholder-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.module-placeholder h2 {
  font-size: 1.125rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.module-placeholder p { font-size: 0.875rem; }

.module-disabled {
  padding: 3rem;
  text-align: center;
  color: var(--gray-600);
  font-size: 0.875rem;
}

.loading, .error-msg {
  padding: 2rem;
  text-align: center;
  color: var(--gray-600);
}

.error-msg { color: #dc2626; }
.error-msg p { margin: 0 0 0.75rem; }
.error-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

/* ── Login ── */
.login-screen {
  min-height: 100vh;
  background-color: #191847;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.login-card-wide { max-width: 420px; }

.login-logo-hero {
  font-size: 4rem;
  margin-bottom: 2rem;
  position: relative;
}

.login-beta {
  display: block;
  font-size: 0.6875rem;
  color: var(--green);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: 0.25rem;
}

.login-sub {
  font-size: 0.875rem;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--gray-600);
  margin: 0 0 1.75rem;
}

.login-error {
  font-size: 0.8125rem;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  text-align: left;
  line-height: 1.45;
}

.login-error code {
  font-size: 0.75rem;
  color: #7f1d1d;
}

.login-card .btn-microsoft {
  max-width: none;
  margin: 0;
}

.login-card .btn-microsoft:disabled {
  opacity: 0.75;
  cursor: wait;
}

.login-hint {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--gray-600);
  line-height: 1.45;
}

.login-status {
  margin: 1.25rem 0 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-700);
}

.login-hint a {
  color: var(--green);
  font-weight: 600;
}

.login-card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 400px;
  width: 100%;
  background: var(--white);
  border-radius: 20px;
  padding: 2.5rem 2rem 2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-logo {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}

.login-logo .my {
  color: var(--green);
  font-size: 1rem;
  display: block;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

.login-tagline {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  margin-bottom: 2.5rem;
}

.login-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--green);
  border-radius: 12px;
  padding: 2rem 1.75rem;
  backdrop-filter: blur(8px);
}

.login-panel h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.login-panel p {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.btn-microsoft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1.25rem;
  background: var(--white);
  color: #5e5e5e;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 2px 6px rgba(25, 24, 71, 0.08);
}

.btn-microsoft:hover {
  background: #f3f3f3;
  color: #5e5e5e;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-microsoft svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.login-footer {
  margin-top: 1.75rem;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.3);
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.625rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-top: 0.35rem;
}

.connection-badge.offline { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.75); }
.connection-badge.live { background: rgba(124, 179, 66, 0.25); color: #9ccc65; }
.connection-badge.error { background: rgba(220, 38, 38, 0.25); color: #fca5a5; }

.settings-btn {
  margin-top: auto;
  padding-top: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  background: var(--white);
  border-radius: 12px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: none;
  background: var(--primary-1);
  color: var(--white);
}

.modal-header h2 {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-heading);
}

.modal-close {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  line-height: 0;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-100);
}

.modal-tab {
  flex: 1;
  padding: 0.625rem;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.modal-tab.active {
  background: var(--white);
  color: var(--primary-1);
  border-bottom: 2px solid var(--primary-2);
  font-weight: 600;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.test-result {
  margin-top: 1rem;
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.test-result.ok { background: rgba(45, 156, 72, 0.12); color: var(--primary-2); }
.test-result.fail { background: rgba(193, 60, 60, 0.1); color: var(--color-error); }

.form-hint {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

.form-hint-error {
  color: var(--color-error);
}

.form-group input.is-invalid,
.form-group input[aria-invalid="true"] {
  border-color: var(--color-error);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.list-picker-wrap {
  max-height: 360px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.list-picker-grid .data-grid {
  min-height: 0;
  flex: 1;
}

.list-picker-grid .data-grid-toolbar {
  padding-top: 0.5rem;
}

.list-picker-grid .data-grid-scroll {
  max-height: 300px;
}

.list-picker-grid th[data-col-key="enabled"],
.list-picker-grid td[data-col-key="enabled"] {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
  text-align: center;
}

.settings-raw-cell {
  display: block;
  font-size: 0.6875rem;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.list-picker-disabled-name {
  opacity: 0.55;
}

.list-picker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.list-picker-table th,
.list-picker-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
}

.list-picker-table th {
  position: sticky;
  top: 0;
  background: var(--gray-50);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600);
  z-index: 1;
}

.list-picker-table tr.disabled td:nth-child(2) {
  opacity: 0.55;
}

.site-badge {
  display: inline-block;
  font-size: 0.625rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: rgba(25, 24, 71, 0.08);
  color: var(--primary-1);
  font-weight: 600;
  text-transform: uppercase;
}

.site-list-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-list-picker-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.site-list-picker-search {
  width: 14rem;
  max-width: 100%;
  padding: 0.4rem 0.75rem;
  min-height: 2rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--ds-surface);
}

.site-list-picker-search:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-muted);
}

.site-list-picker .list-picker-wrap {
  max-height: 240px;
}

.site-connection-block {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.site-connection-block:last-of-type {
  border-bottom: none;
}

.site-connection-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary-1);
  margin: 0 0 0.75rem;
  font-family: var(--font-heading);
}

.list-registry {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
}

.list-registry-row {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.8125rem;
}

.list-registry-row:last-child { border-bottom: none; }
.list-registry-row.disabled { opacity: 0.55; }

.module-badge {
  display: inline-block;
  font-size: 0.625rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--gray-200);
  color: var(--gray-600);
  margin-left: 0.35rem;
  text-transform: uppercase;
}

.btn-sm { padding: 0.3rem 0.625rem; font-size: 0.75rem; }

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

@media (max-width: 1024px) {
  .content { flex-direction: column; }
  .filter-drawer { width: min(100vw, var(--panel-width)); }
  .dashboard-bottom {
    flex-direction: column;
  }
  .kpi-row {
    grid-template-columns: 1fr;
  }
}

/* ── Filter drawer (hidden by default) ── */
.filter-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.25);
  z-index: 40;
}

.filter-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--panel-width);
  background: var(--filter-bg);
  border-left: 1px solid var(--gray-300);
  box-shadow: -4px 0 16px rgba(0,0,0,0.08);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.filter-drawer.open {
  transform: translateX(0);
}

.filter-drawer .panel-header {
  background: var(--white);
  justify-content: space-between;
}

.btn-panel-close {
  border: none;
  background: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-600);
  padding: 0.25rem;
}

.filter-drawer .form-group { padding: 0 1rem; }
.filter-drawer .checkbox-group { padding: 0 1rem 0.75rem; }
.filter-drawer .checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  margin-bottom: 0.375rem;
  cursor: pointer;
}

/* ── Dashboard (Dribbble-style cards) ── */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  flex: 1;
  min-height: 0;
}

.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.dashboard-actions-panel {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.panel-empty-hint {
  padding: 0 1rem;
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.dashboard-middle {
  flex: 1;
  min-height: 0;
}

.dashboard-bottom {
  display: flex;
  gap: 0.875rem;
  flex-shrink: 0;
}

.chart-card {
  background: var(--ds-surface, var(--white));
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: 16px;
  padding: 1.25rem 1.5rem 1rem;
  min-height: 0;
  box-shadow: 0 4px 16px rgba(25, 24, 71, 0.05);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chart-card-body {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  gap: 0;
}

.chart-card-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chart-filter-panel {
  width: 220px;
  flex-shrink: 0;
  border-left: 1px solid var(--gray-200);
  margin: -0.25rem -1.5rem -1rem 1rem;
  padding-bottom: 0.75rem;
  border-radius: 0 16px 16px 0;
  overflow-y: auto;
}

.operacao-chart-card .chart-card-body {
  position: relative;
}

.chart-filter-popover {
  position: fixed;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: min(520px, calc(100vh - 24px));
  z-index: 30;
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(25, 24, 71, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chart-filter-popover.app-select-popover {
  z-index: 13000;
  width: auto;
  min-width: 0;
}

.chart-filter-popover.app-select-popover.is-combo,
.chart-filter-popover.app-select-popover.is-list {
  border-radius: 0 0 8px 8px;
  border-top: 0;
  box-shadow: 0 16px 32px rgba(25, 24, 71, 0.12);
}

.chart-filter-popover.app-select-popover.is-combo.is-flip,
.chart-filter-popover.app-select-popover.is-list.is-flip {
  border-radius: 8px 8px 0 0;
  border-top: 1px solid var(--ds-border, var(--gray-200));
  border-bottom: 0;
}

.chart-filter-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 1rem 0.55rem;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.98);
}

.chart-filter-popover-header > .chart-filter-popover-title {
  flex: 1;
  min-width: 0;
}

.chart-filter-popover-header > .ui-tooltip-host,
.cal-event-popover-header > .ui-tooltip-host {
  width: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
}

.chart-filter-popover-header .btn-icon-ghost {
  flex-shrink: 0;
}

.chart-filter-popover-title {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  line-height: 1.2;
}

.chart-filter-popover-body {
  padding: 0.75rem 1rem 0.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chart-filter-popover .chart-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.chart-filter-popover .form-group {
  padding: 0;
  margin: 0;
}

.chart-filter-popover .form-group label {
  margin-bottom: 0.3rem;
}

.chart-filter-popover .checkbox-group {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chart-filter-popover .checkbox-group-title,
.chart-filter-panel .checkbox-group-title {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-600);
  margin: 0;
}

.chart-filter-popover .checkbox-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chart-filter-popover .avaliacao-check {
  margin: 0;
}

.chart-filter-popover-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.98);
}

.chart-filter-popover-actions .btn {
  width: 100%;
  margin: 0;
}

.chart-filter-popover .btn-primary {
  width: 100%;
  margin: 0;
}

.chart-filter-panel .form-group,
.chart-filter-panel .checkbox-group {
  padding: 0 1rem;
}

.chart-filter-panel .checkbox-group {
  margin-bottom: 0.75rem;
}

.chart-filter-panel .btn-primary {
  width: calc(100% - 2rem);
  margin: 0 1rem;
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.chart-card-header-main {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.chart-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.6875rem;
  color: var(--gray-600);
  margin-bottom: 0;
}

.chart-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
  margin-right: 0.25rem;
  flex-shrink: 0;
}

.operacao-chart-card {
  min-height: 0;
  height: 100%;
}

.operacao-chart-card .chart-card-header {
  margin-bottom: 0.5rem;
}

.operacao-chart-metric-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--green-dark, #268a3e);
  background: var(--green-muted);
  vertical-align: middle;
}

.operacao-chart-summary {
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.operacao-chart-help-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.operacao-chart-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.06);
  color: var(--gray-600);
  cursor: help;
  transition: background 0.12s ease, color 0.12s ease;
}

.operacao-chart-help-btn:hover,
.operacao-chart-help-btn:focus-visible {
  background: rgba(45, 156, 72, 0.12);
  color: var(--primary-2);
  outline: none;
}

.operacao-chart-help-tip {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  max-width: min(280px, 70vw);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--navy-deep, #1f2c5c);
  color: #fff;
  font-size: 0.6875rem;
  line-height: 1.45;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}

.operacao-chart-help-wrap:hover .operacao-chart-help-tip,
.operacao-chart-help-wrap:focus-within .operacao-chart-help-tip {
  opacity: 1;
  visibility: visible;
}

.operacao-chart-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}

.operacao-chart-filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 6;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--primary-2);
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}

.operacao-pie-layout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  padding: 0.25rem 0 0.5rem;
}

.operacao-pie-visual {
  flex: 0 0 46%;
  max-width: 180px;
  min-width: 120px;
}

.operacao-pie-svg {
  width: 100%;
  height: auto;
  display: block;
}

.operacao-pie-slice {
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform-origin: 100px 100px;
}

.operacao-pie-slice.is-dim {
  opacity: 0.45;
}

.operacao-pie-slice.is-hot {
  opacity: 1;
  filter: brightness(1.06);
}

.operacao-pie-slice-label {
  font-size: 10px;
  font-weight: 700;
  fill: #fff;
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 2px;
  stroke-linejoin: round;
  pointer-events: none;
}

.operacao-pie-slice-tip-bg {
  fill: var(--navy, #1f2c5c);
  opacity: 0.95;
}

.operacao-pie-slice-tip-text {
  font-size: 10px;
  font-weight: 700;
  fill: #fff;
}

.operacao-pie-hole {
  fill: var(--ds-surface, var(--white));
}

.operacao-pie-center-label {
  font-size: 9px;
  font-weight: 600;
  fill: var(--gray-600);
}

.operacao-pie-center-value {
  font-size: 11px;
  font-weight: 700;
  fill: var(--navy, #1f2c5c);
}

.operacao-pie-center-pct {
  font-size: 9px;
  font-weight: 700;
  fill: var(--accent, #2d9c48);
}

.operacao-pie-legend {
  list-style: none;
  margin: 0;
  padding: 0.1rem 0.15rem 0.1rem 0;
  flex: 1;
  min-width: 0;
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.operacao-pie-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-700);
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  cursor: default;
}

.operacao-pie-legend li.is-hot {
  background: var(--green-muted);
}

.operacao-pie-legend li.is-home .operacao-pie-legend-label {
  color: var(--navy);
}

.operacao-pie-legend li.is-eu {
  margin-bottom: 0.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(31, 44, 92, 0.12);
}

.operacao-pie-legend li.is-eu .operacao-pie-legend-label {
  font-weight: 700;
}

.operacao-pie-legend .chart-legend-dot {
  width: 10px;
  height: 10px;
  margin: 0.28rem 0 0;
}

.operacao-pie-legend-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.operacao-pie-legend-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.operacao-pie-home-tag {
  flex-shrink: 0;
  font-style: normal;
  font-weight: 700;
  font-size: 0.625rem;
  margin-left: 0;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  color: #2D9C48;
  background: rgba(45, 156, 72, 0.12);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operacao-pie-slice.is-home path {
  stroke: #ffffff;
  stroke-width: 1.5;
}

.operacao-pie-slice.is-eu path {
  stroke: #ffffff;
  stroke-width: 2;
}

.operacao-pie-legend-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.25;
}

.operacao-pie-legend-values {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.operacao-pie-legend-amt {
  font-weight: 700;
  color: var(--navy, #1f2c5c);
  white-space: nowrap;
}

.operacao-pie-legend-pct {
  font-weight: 700;
  color: var(--accent, #2d9c48);
  white-space: nowrap;
}

.operacao-pie-legend-split {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  color: var(--gray-600);
  font-size: 0.6875rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.operacao-pie-legend-split i {
  font-style: normal;
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-right: 0.28rem;
}

.chart-filter-panel .checkbox-group-title {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 1.5rem;
  flex: 1;
  min-height: 140px;
  padding: 0 1rem;
  border-bottom: 1px solid var(--gray-300);
}

.bar-group {
  flex: 1;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 64px;
  background: linear-gradient(180deg, var(--primary-2) 0%, var(--primary-1) 100%);
  border-radius: 8px 8px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}

.bar-label {
  font-size: 0.6875rem;
  color: var(--gray-600);
  margin-top: 0.5rem;
  text-align: center;
}

.bar-value {
  font-size: 0.625rem;
  color: var(--navy);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.dashboard-channels {
  flex: 1;
  min-width: 0;
  background: var(--ds-surface, var(--white));
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: 16px;
  padding: 1rem 1.25rem 1.125rem;
  box-shadow: 0 4px 16px rgba(25, 24, 71, 0.05);
}

.dashboard-channels-head h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.avaliacao-card {
  --avaliacao-accent: var(--primary-2);
  position: relative;
  flex: 1;
  width: 100%;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(45, 156, 72, 0.28) 0%, transparent 55%),
    linear-gradient(155deg, #152a4a 0%, var(--navy-deep) 48%, #152048 100%);
  border-radius: 16px;
  box-shadow:
    0 10px 28px rgba(15, 28, 55, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 0.85rem 0.9rem 0.8rem;
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  text-align: left;
  min-height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  isolation: isolate;
}

.avaliacao-card-glow {
  position: absolute;
  inset: auto -20% -45% auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(45, 156, 72, 0.35) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.avaliacao-card-top,
.avaliacao-card-body,
.avaliacao-card .btn-fill {
  position: relative;
  z-index: 1;
}

.avaliacao-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.avaliacao-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: rgba(45, 156, 72, 0.22);
  border: 1px solid rgba(45, 156, 72, 0.45);
  box-shadow: 0 0 0 4px rgba(45, 156, 72, 0.08);
}

.avaliacao-card-period {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.avaliacao-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  flex: 1;
}

.avaliacao-card h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.avaliacao-card-sub {
  font-size: 0.6875rem;
  opacity: 0.72;
  margin: 0;
  line-height: 1.3;
}

.avaliacao-card-status {
  display: inline-flex;
  align-items: center;
  margin-top: 0.45rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.avaliacao-card-status.status-open {
  background: rgba(45, 156, 72, 0.2);
  border-color: rgba(45, 156, 72, 0.4);
  color: #b7efc5;
}

.avaliacao-card-status.status-urgent {
  background: rgba(255, 186, 73, 0.18);
  border-color: rgba(255, 186, 73, 0.4);
  color: #ffe0a3;
}

.avaliacao-card-status.status-done {
  background: rgba(45, 156, 72, 0.28);
  border-color: rgba(45, 156, 72, 0.5);
  color: #d4f5dd;
}

.avaliacao-card-status.status-closed,
.avaliacao-card-status.status-idle,
.avaliacao-card-status.status-loading {
  opacity: 0.9;
}

.avaliacao-card .btn-fill {
  margin-top: 0.7rem;
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.85rem;
  background: linear-gradient(180deg, #3ab055 0%, var(--primary-2) 100%);
  color: var(--white);
  border: none;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 6px 14px rgba(45, 156, 72, 0.28);
}

.avaliacao-card .btn-fill:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(45, 156, 72, 0.36);
}

.avaliacao-card .btn-fill:disabled {
  opacity: 0.65;
  cursor: default;
  box-shadow: none;
}

.avaliacao-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #2D9C48;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(45, 156, 72, 0.28);
}
.avaliacao-fab.tone-open,
.avaliacao-fab.tone-urgent {
  animation: avaliacao-fab-glow 2.4s ease-in-out infinite;
}
.avaliacao-fab.tone-closed,
.avaliacao-fab.tone-idle,
.avaliacao-fab.tone-done,
.avaliacao-fab.tone-loading {
  animation: none;
  box-shadow: 0 6px 14px rgba(31, 44, 92, 0.18);
}
.avaliacao-fab.tone-closed,
.avaliacao-fab.tone-idle {
  background: #1F2C5C;
}
.avaliacao-fab-icon {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: transparent;
}
.avaliacao-fab-label {
  position: absolute;
  right: calc(100% + 0.7rem);
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  color: #1F2C5C;
  border-left: 3px solid #2D9C48;
  box-shadow: 0 8px 22px rgba(25, 24, 71, 0.16);
  font-size: 0.84rem;
  transition: opacity 0.2s ease, transform 0.24s ease;
}
.avaliacao-fab:hover .avaliacao-fab-label,
.avaliacao-fab:focus-visible .avaliacao-fab-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
@keyframes avaliacao-fab-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 156, 72, 0.35), 0 10px 22px rgba(45, 156, 72, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(45, 156, 72, 0.16), 0 10px 26px rgba(45, 156, 72, 0.45); }
}

.avaliacao-card-shell {
  padding: 0;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.avaliacao-card-fill {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}

.avaliacao-card-shell .avaliacao-card {
  height: 100%;
  min-height: 0;
}

.avaliacao-panel {
  padding: 0;
  overflow: hidden;
  background: var(--white);
}

.avaliacao-modal-overlay {
  z-index: 1600;
}

.avaliacao-modal.negocio-modal {
  width: min(960px, 96vw);
  max-height: min(92vh, 860px);
  height: min(860px, 92vh);
}

.avaliacao-modal .negocio-modal-panel.avaliacao-workspace,
.avaliacao-workspace {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: inherit;
  box-sizing: border-box;
}

.avaliacao-modal .negocio-modal-header {
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.avaliacao-modal .negocio-modal-header h3 {
  white-space: normal;
  color: var(--white);
}

.avaliacao-tabs-bar {
  flex-shrink: 0;
  width: 100%;
  padding: 0.75rem 1.25rem 0;
  box-sizing: border-box;
  background: #fff;
}

.avaliacao-modal .avaliacao-tabs.tabs-segmented {
  display: flex;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.avaliacao-modal .avaliacao-tabs.tabs-segmented .tab {
  flex: 1 1 0;
  text-align: center;
  justify-content: center;
}

.avaliacao-mode-label {
  margin: 0 1rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary-2);
}

.avaliacao-workspace-body.negocio-modal-body,
.avaliacao-workspace-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0.85rem 1.15rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--ds-surface-muted, #f5f7fb);
}

.avaliacao-float-msg {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: rgba(45, 156, 72, 0.1);
  color: var(--navy);
  font-size: 0.8125rem;
}

.avaliacao-closed-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.35rem 0.15rem 0.5rem;
}

.avaliacao-team-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  flex-shrink: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ds-border, #e2e6ee);
  border-radius: 12px;
  background: #fff;
}

.avaliacao-team-tools input[type="search"],
.avaliacao-team-tools select {
  min-height: 36px;
  border: 1px solid var(--ds-border, #e2e6ee);
  border-radius: 10px;
  padding: 0 0.7rem;
  font: inherit;
  color: #1F2C5C;
  background: var(--white);
}

.avaliacao-team-tools input[type="search"]:focus,
.avaliacao-team-tools select:focus {
  outline: none;
  border-color: var(--green, #2D9C48);
  box-shadow: 0 0 0 3px rgba(45, 156, 72, 0.16);
}

.avaliacao-team-tools input[type="search"] {
  flex: 1 1 180px;
  min-width: 160px;
}

.avaliacao-team-tools .btn {
  flex: 0 0 auto;
}

.avaliacao-team-tools .dash-prob-chip {
  flex: 0 0 auto;
}

.avaliacao-periodo {
  margin: 0 0 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--ds-border, #e2e6ee);
  border-left: 4px solid var(--green, #2D9C48);
  border-radius: 12px;
  background: #fff;
}
.avaliacao-periodo-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-start;
  justify-content: space-between;
}
.avaliacao-periodo-head strong {
  display: block;
  color: var(--navy);
  font-size: 0.82rem;
}
.avaliacao-periodo-head p {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--ds-text-muted, #5b6b7c);
}
.avaliacao-periodo-status {
  font-weight: 700;
  color: var(--navy);
}
.avaliacao-periodo-status.is-aberto { color: var(--green, #2D9C48); }
.avaliacao-periodo-status.is-bloqueado { color: #b45309; }
.avaliacao-periodo-status.is-terminado,
.avaliacao-periodo-status.is-fechado { color: #6b7c93; }
.avaliacao-periodo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.avaliacao-periodo-form {
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--ds-border, #e2e6ee);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.avaliacao-periodo-form .chart-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.avaliacao-periodo-form .form-group {
  margin: 0;
}
.avaliacao-periodo-form .form-group label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.2rem;
}
.avaliacao-periodo-form input,
.avaliacao-periodo-form select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0 0.6rem;
  font: inherit;
  color: var(--navy);
  background: #fff;
  box-sizing: border-box;
}
.avaliacao-periodo-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.avaliacao-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  min-height: 2.25rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--ds-border, #e2e6ee);
  background: #fff;
  color: var(--navy, #1F2C5C);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.avaliacao-check:hover {
  border-color: rgba(45, 156, 72, 0.45);
  background: rgba(45, 156, 72, 0.06);
}

.avaliacao-check:has(input:checked),
.avaliacao-check.is-on {
  border-color: var(--green, #2D9C48);
  background: rgba(45, 156, 72, 0.1);
  box-shadow: inset 3px 0 0 var(--green, #2D9C48);
}

.avaliacao-check input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--green, #2D9C48);
  cursor: pointer;
}

.avaliacao-periodo-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.avaliacao-team-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.avaliacao-team-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 0.15rem;
}

.avaliacao-form,
.avaliacao-compare {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.avaliacao-team-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-height: 0;
}

.avaliacao-team-pagination {
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--ds-border, #e2e6ee);
  background: #fff;
  color: #1F2C5C;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.avaliacao-team-pager {
  display: inline-flex;
  gap: 0.35rem;
}

.avaliacao-back-btn {
  align-self: flex-start;
  margin-bottom: 0.35rem;
}

.avaliacao-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  border: 1px solid var(--ds-border, #e2e6ee);
  border-left: 4px solid #1F2C5C;
  border-radius: 12px;
  background: #fff;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.avaliacao-team-row.is-done {
  border-left-color: var(--green, #2D9C48);
}

.avaliacao-team-row.is-not-admitted {
  border-left-color: #c5cad6;
}

.avaliacao-team-row .avaliacao-team-admissao {
  color: #5c6784;
}

.avaliacao-team-row:hover {
  border-color: var(--green, #2D9C48);
  box-shadow: 0 4px 14px rgba(31, 44, 92, 0.08);
}

.avaliacao-team-who {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.avaliacao-team-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 44, 92, 0.08);
  color: #1F2C5C;
  font-size: 0.8125rem;
  font-weight: 700;
  overflow: hidden;
}

.avaliacao-team-avatar .consultor-card-photo,
.avaliacao-team-avatar .consultor-card-initials {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}

.avaliacao-team-row strong {
  display: block;
  color: #1F2C5C;
}

.avaliacao-team-row span {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-600);
}

.avaliacao-medias {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 0;
}

.avaliacao-status-pill,
.avaliacao-badge {
  align-self: center;
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.32rem 0.58rem;
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.08);
  color: #1F2C5C;
  white-space: nowrap;
}

.avaliacao-status-pill.is-on,
.avaliacao-badge {
  background: var(--green-muted, rgba(45, 156, 72, 0.12));
  color: var(--green-dark, #268a3e);
}

.avaliacao-team-row .avaliacao-status-pill.is-na {
  background: rgba(31, 44, 92, 0.06);
  color: #5c6784;
}

.avaliacao-section {
  border: 2px solid var(--primary-2);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.avaliacao-section > header {
  background: var(--primary-2);
  color: #fff;
  font-weight: 700;
  padding: 0.65rem 0.75rem;
}

.avaliacao-question {
  padding: 0.75rem;
  border-top: 1px solid rgba(45, 156, 72, 0.25);
}

.avaliacao-question-head {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
  color: var(--navy);
  font-size: 0.8125rem;
}

.avaliacao-question-head > strong {
  flex-shrink: 0;
}

.avaliacao-question-head > span:not(.avaliacao-tip) {
  flex: 1;
  min-width: 0;
}

.avaliacao-tip {
  position: relative;
  margin-left: auto;
  flex: 0 0 auto;
  align-self: flex-start;
}

.avaliacao-tip-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1.5px solid var(--primary-2);
  background: rgba(45, 156, 72, 0.08);
  color: var(--primary-2);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.avaliacao-tip-btn:hover,
.avaliacao-tip.is-open .avaliacao-tip-btn {
  background: var(--primary-2);
  color: #fff;
}

.avaliacao-tip-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(280px, 70vw);
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  box-shadow: 0 12px 28px rgba(25, 24, 71, 0.16);
  color: var(--navy);
}

.avaliacao-tip-panel strong {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.avaliacao-tip-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.avaliacao-tip-panel li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--gray-600);
}

.avaliacao-tip-panel li em {
  font-style: normal;
  font-weight: 700;
  color: var(--navy);
}

.avaliacao-tip-score {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary-1);
  color: var(--primary-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.6875rem;
  flex-shrink: 0;
}

.avaliacao-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

.avaliacao-scale-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 56px;
  padding: 0.4rem 0.25rem;
  border-radius: 10px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.avaliacao-scale-btn:hover {
  border-color: var(--primary-2);
  background: rgba(45, 156, 72, 0.06);
}

.avaliacao-scale-btn.active {
  border-color: var(--primary-2);
  background: var(--primary-2);
  color: #fff;
  box-shadow: 0 4px 12px rgba(45, 156, 72, 0.25);
}

.avaliacao-scale-num {
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1;
}

.avaliacao-scale-label {
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  opacity: 0.9;
}

.avaliacao-question textarea {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  color: var(--navy);
  resize: vertical;
}

.avaliacao-question textarea:focus {
  outline: none;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(45, 156, 72, 0.15);
}

.avaliacao-workspace-foot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--gray-200);
  background: #f7f8fa;
  flex-shrink: 0;
}

.avaliacao-req {
  margin-right: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy);
  background: rgba(25, 24, 71, 0.06);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}

.avaliacao-compare-legend {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.avaliacao-compare-legend .chip {
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
}

.avaliacao-compare-legend .chip.colab,
.avaliacao-compare-vals .chip.colab {
  background: var(--primary-2);
  color: #fff;
}

.avaliacao-compare-legend .chip.dir,
.avaliacao-compare-vals .chip.dir {
  background: var(--primary-1);
  color: var(--primary-2);
}

.avaliacao-compare-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid rgba(45, 156, 72, 0.2);
  align-items: center;
}

.avaliacao-compare-q {
  font-size: 0.75rem;
  color: var(--navy);
}

.avaliacao-compare-vals {
  display: flex;
  gap: 0.4rem;
}

.avaliacao-compare-vals .chip {
  min-width: 32px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 0.55rem;
}

@media (max-width: 720px) {
  .avaliacao-scale { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .avaliacao-team-row { flex-direction: column; }
  .avaliacao-compare-row { grid-template-columns: 1fr; }
  .avaliacao-tip-panel { right: auto; left: 0; }
}

.notif-bell-btn {
  position: relative;
}

.notif-bell-btn.is-open {
  background: rgba(25, 24, 71, 0.08);
}

.notif-bell-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.topbar-module .notif-bell-btn {
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border, var(--gray-200));
  color: var(--brand-navy);
  width: 2.5rem;
  height: 2.5rem;
}

.topbar-module .notif-bell-btn:hover,
.topbar-module .notif-bell-btn.is-open {
  background: rgba(31, 44, 92, 0.06);
}

.notif-float-panel {
  z-index: 1500;
  max-height: min(70vh, 520px);
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  padding: 0.65rem 0.75rem 0.85rem;
}

.notif-float-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0 0.1rem 0.35rem;
  border-bottom: 1px solid var(--gray-200);
}

.notif-float-header h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--navy);
}

.notif-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary-2);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.notif-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.15rem 0.05rem 0.25rem;
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.notif-item {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.notif-item.severity-warning {
  border-color: rgba(45, 156, 72, 0.35);
  background: rgba(45, 156, 72, 0.06);
}

.notif-item.severity-info {
  border-color: rgba(25, 24, 71, 0.15);
  background: rgba(25, 24, 71, 0.03);
}

.notif-item.severity-success {
  border-color: rgba(45, 156, 72, 0.25);
}

.notif-item strong {
  color: var(--navy);
  font-size: 0.8125rem;
}

.notif-item p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.notif-hint {
  font-size: 0.6875rem;
  color: var(--primary-2);
  font-weight: 600;
}

.notif-item .btn {
  align-self: flex-start;
  margin-top: 0.25rem;
}

.notif-admin-actions {
  border-top: 1px solid var(--gray-200);
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.faturacao-strip {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(25, 24, 71, 0.06);
}

.faturacao-strip h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.faturacao-scroll {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.faturacao-item {
  flex-shrink: 0;
  text-align: center;
  min-width: 72px;
}

.faturacao-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-1);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.35rem;
}

.faturacao-icon .ui-icon {
  color: var(--white);
}

.faturacao-type {
  font-size: 0.625rem;
  color: var(--navy);
  font-weight: 600;
}

.faturacao-name {
  font-size: 0.5625rem;
  color: var(--gray-600);
}

.faturacao-amount {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--green-dark);
}

/* ── Equipa cards ── */
@keyframes equipa-card-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.equipa-toolbar,
.equipa-location-rail {
  flex-shrink: 0;
}

.equipa-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 0.25rem;
}

.equipa-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0;
}

.equipa-stats-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-600);
  font-weight: 500;
}

.equipa-stats-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gray-400);
}

.equipa-enteras-btn {
  flex-shrink: 0;
}

.equipa-enteras-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(25, 24, 71, 0.92);
  color: var(--white);
  border-radius: 12px;
  font-size: 0.8125rem;
}

.equipa-enteras-actions {
  display: flex;
  gap: 0.5rem;
}

.consultor-card.selectable {
  cursor: pointer;
}

/* ── View as picker (Equipa / Power Apps enteras) — portaled to body ── */
.view-as-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(25, 24, 71, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: auto;
}

.view-as-dialog {
  width: min(560px, 100%);
  max-height: min(520px, 90vh);
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.view-as-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--green);
  color: var(--white);
}

.view-as-header h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: center;
}

.view-as-close {
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
}

.view-as-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  flex: 1;
}

.view-as-search {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.view-as-list {
  overflow-y: auto;
  max-height: 320px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.view-as-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--gray-100);
  background: var(--white);
  padding: 0.625rem 0.75rem;
  text-align: left;
  cursor: pointer;
}

.view-as-row:last-child {
  border-bottom: none;
}

.view-as-row:hover,
.view-as-row.selected {
  background: var(--green-muted);
}

.view-as-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.view-as-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.view-as-row-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
}

.view-as-row-email {
  font-size: 0.6875rem;
  color: var(--gray-600);
}

.view-as-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50, #fafafa);
}

.equipa-search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 0.625rem 0.875rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.location-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.location-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 600;
}

.equipa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 1.125rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  padding-right: 2px;
}

.equipa-layout .module-page-table {
  flex: 1;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  .consultor-card {
    animation: none;
  }

  .consultor-card-inner {
    transition: none;
  }

  .consultor-card.selectable:hover:not(.is-flipped) .consultor-card-front,
  .consultor-card:hover:not(.is-flipped) .consultor-card-avatar {
    transform: none;
  }
}

.equipa-location-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0.05rem 0 0.35rem;
  padding: 0.05rem 0.3rem 0.1rem;
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.equipa-location-orbit {
  --hub: 72px;
  --sat: 64px;
  --orbit: 118px;
  --hub-top: 3.1rem;
  position: relative;
  width: min(100%, 21.5rem);
  height: 14.15rem;
  margin: 0 auto;
}

.equipa-location-orbit > .equipa-location-node.is-direcao {
  position: absolute;
  left: 50%;
  top: var(--hub-top);
  transform: translate(-50%, -42%);
  z-index: 3;
}

.equipa-location-rail-locals {
  position: absolute;
  inset: 0;
  margin: 0;
  display: block;
  z-index: 1;
}

.equipa-location-rail-locals .equipa-location-node {
  --a: 90deg;
  position: absolute;
  left: 50%;
  top: var(--hub-top);
  transform: translate(-50%, -42%) rotate(var(--a)) translateX(var(--orbit)) rotate(calc(var(--a) * -1));
}

/* Bottom arc only — same placement as the reference icon. */
.equipa-location-rail-locals .equipa-location-node:nth-child(1) { --a: 158deg; }
.equipa-location-rail-locals .equipa-location-node:nth-child(2) { --a: 22deg; }
.equipa-location-rail-locals .equipa-location-node:nth-child(3) { --a: 90deg; --orbit: 112px; }

.equipa-location-rail::before {
  display: none;
}

.equipa-location-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 1;
  min-width: 5.5rem;
  max-width: 6.4rem;
  flex: 0 0 auto;
  margin-left: 0;
  transition: filter 0.18s ease;
}

.equipa-location-node:first-child {
  margin-left: 0;
}

.equipa-location-node:hover,
.equipa-location-node.active {
  z-index: 5;
}

.equipa-location-node:hover .equipa-location-media,
.equipa-location-node.active .equipa-location-media {
  transform: scale(1.06);
}

.equipa-location-media {
  position: relative;
  width: var(--sat, 64px);
  height: var(--sat, 64px);
  min-height: 0;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: transparent;
  overflow: visible;
  display: block;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s ease;
  box-shadow:
    0 3px 8px rgba(25, 24, 71, 0.12),
    0 1px 2px rgba(25, 24, 71, 0.06);
}

.equipa-location-node.active .equipa-location-media {
  border-color: var(--green);
  box-shadow:
    0 0 0 3px rgba(45, 156, 72, 0.28),
    0 8px 20px rgba(25, 24, 71, 0.14);
}

.equipa-location-node.is-direcao {
  min-width: 5.6rem;
  max-width: 6.6rem;
  z-index: 2;
}

.equipa-location-node.is-direcao .equipa-location-media {
  width: var(--hub, 72px);
  height: var(--hub, 72px);
  min-height: 0;
  border-radius: 50%;
  box-shadow:
    0 5px 12px rgba(25, 24, 71, 0.16),
    0 0 0 1px rgba(212, 160, 23, 0.35);
}

.equipa-location-node.is-direcao .equipa-location-color {
  background: #fff;
  inset: 0;
}

.equipa-location-node.is-direcao .equipa-location-clip {
  background: transparent;
}

.equipa-location-node.is-direcao .equipa-location-bg {
  inset: auto;
  top: 50%;
  left: 50%;
  width: 68%;
  height: 40%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  object-position: center;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.equipa-location-node.is-direcao.active .equipa-location-media {
  box-shadow:
    0 0 0 3px rgba(45, 156, 72, 0.3),
    0 8px 22px rgba(25, 24, 71, 0.16),
    0 0 0 1px rgba(212, 160, 23, 0.45);
}

.equipa-location-portrait,
.equipa-location-portrait .consultor-card-photo,
.equipa-location-portrait .consultor-card-initials {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.equipa-location-color {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: var(--navy);
  pointer-events: none;
  z-index: 0;
}

.equipa-location-clip {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  isolation: isolate;
  pointer-events: none;
  z-index: 1;
}

.equipa-location-bg,
.equipa-location-bg-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: transparent;
}

.equipa-location-bg-fallback,
.equipa-location-bg-fallback-direcao {
  background: transparent;
}

.equipa-location-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  background: var(--navy);
  color: var(--white);
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(25, 24, 71, 0.28);
  backdrop-filter: blur(4px);
}

.equipa-location-count.tone-0 {
  background: var(--navy);
}

.equipa-location-count.tone-1 {
  background: var(--green);
}

.equipa-location-count.tone-2 {
  background: #1f6f8b;
}

.equipa-location-director {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: var(--gray-100);
  overflow: hidden;
  z-index: 4;
  box-shadow:
    0 1px 4px rgba(25, 24, 71, 0.28),
    0 0 0 1px rgba(25, 24, 71, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.equipa-location-director .consultor-card-photo,
.equipa-location-director .consultor-card-initials {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  object-fit: cover;
}

.equipa-location-node.is-direcao .equipa-location-director {
  width: 36px;
  height: 36px;
  border-color: #f0c84a;
  box-shadow:
    0 1px 6px rgba(25, 24, 71, 0.3),
    0 0 0 1px rgba(212, 160, 23, 0.35);
}

.equipa-location-node.is-direcao .equipa-location-count {
  min-width: 1.25rem;
  height: 1.25rem;
  font-size: 0.625rem;
}

.equipa-location-node.is-direcao .equipa-location-label {
  font-size: 0.75rem;
}

.equipa-location-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0 0.15rem;
  min-width: 0;
  text-align: center;
}

.equipa-location-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--navy);
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equipa-location-node.active .equipa-location-label {
  color: var(--green-dark, #1f7a35);
}

.equipa-location-director-name {
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--gray-700, #424242);
  line-height: 1.25;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equipa-location-director-name.is-empty {
  color: var(--gray-400);
  font-weight: 500;
}

.equipa-location-role {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-400);
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equipa-location-node.is-direcao .equipa-location-role {
  color: #b08920;
}

/* Legacy badge class kept for safety */
.equipa-location-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  border: 2px solid var(--white);
  background: var(--navy);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(25, 24, 71, 0.2);
}

.equipa-location-badge.tone-0 {
  background: var(--navy);
}

.equipa-location-badge.tone-1 {
  background: var(--green);
}

.equipa-location-badge.tone-2 {
  background: #1f6f8b;
}

/* Soft member cards (Cards view — no location panels) */
.equipa-cards {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem 0.15rem 0.75rem;
}

.equipa-member-card {
  position: relative;
  width: 168px;
  min-height: 216px;
  height: 216px;
  padding: 0;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 18px;
  color: var(--navy);
  cursor: default;
  perspective: 720px;
  contain: layout style;
  animation: equipa-card-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.equipa-member-card.selectable {
  cursor: pointer;
}

.equipa-member-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 216px;
  transform-style: preserve-3d;
  transform: translateZ(0);
  transition: transform 0.38s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.equipa-member-card.is-flipped .equipa-member-card-inner {
  transform: rotateY(180deg);
}

.equipa-member-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.85rem 0.7rem 0.55rem;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.equipa-member-card-front {
  background: transparent;
  transform: rotateY(0deg);
  overflow: visible;
}

.equipa-member-card:hover .equipa-member-card-front,
.equipa-member-card.selected .equipa-member-card-front {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 16px rgba(25, 24, 71, 0.08);
}

.equipa-member-card.selected .equipa-member-card-front {
  background: var(--green-muted);
  box-shadow: 0 0 0 2px rgba(45, 156, 72, 0.28);
}

.equipa-member-card-back {
  transform: rotateY(180deg);
  padding: 0;
  background-color: var(--navy);
  color: #fff;
  box-shadow: 0 8px 22px rgba(25, 24, 71, 0.22);
  align-items: stretch;
  flex-direction: row;
  overflow: hidden;
}

.equipa-member-card-avatar {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
}

.equipa-member-card-avatar-ring {
  box-sizing: border-box;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  padding: 0;
  border: 3px solid var(--white);
  background: var(--white);
  box-shadow:
    0 0 0 2px rgba(25, 24, 71, 0.08),
    0 2px 8px rgba(25, 24, 71, 0.1);
  overflow: hidden;
  display: block;
  line-height: 0;
  position: relative;
}

.equipa-member-card.is-top-commission .equipa-member-card-avatar-ring {
  box-shadow:
    0 0 0 2px var(--white),
    0 0 0 4px rgba(45, 156, 72, 0.45),
    0 2px 10px rgba(45, 156, 72, 0.2);
}

.equipa-member-card.is-top-commission.rank-1 .equipa-member-card-avatar-ring {
  box-shadow:
    0 0 0 2px var(--white),
    0 0 0 4px rgba(212, 160, 23, 0.55),
    0 2px 10px rgba(212, 160, 23, 0.25);
}

.equipa-member-card.is-top-commission.rank-2 .equipa-member-card-avatar-ring {
  box-shadow:
    0 0 0 2px var(--white),
    0 0 0 4px rgba(120, 134, 156, 0.5),
    0 2px 10px rgba(120, 134, 156, 0.22);
}

.equipa-member-card.is-top-commission.rank-3 .equipa-member-card-avatar-ring {
  box-shadow:
    0 0 0 2px var(--white),
    0 0 0 4px rgba(176, 112, 58, 0.5),
    0 2px 10px rgba(176, 112, 58, 0.22);
}

.equipa-member-card-avatar-ring .consultor-card-photo,
.equipa-member-card-avatar-ring .consultor-card-initials {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  display: block;
  margin: 0;
}

.equipa-member-card-star {
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translate(-50%, 45%);
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid var(--white);
  background: var(--green, #2d9c48);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  z-index: 5;
  box-shadow: 0 1px 4px rgba(25, 24, 71, 0.28);
  pointer-events: none;
  line-height: 1;
}

.equipa-member-card-star.rank-1 {
  background: linear-gradient(180deg, #f0c84a 0%, #d4a017 100%);
  min-width: 36px;
}

.equipa-member-card-star.rank-2 {
  background: linear-gradient(180deg, #c5ced8 0%, #7b8798 100%);
  min-width: 30px;
}

.equipa-member-card-star.rank-3 {
  background: linear-gradient(180deg, #d4a574 0%, #b0703a 100%);
}

.equipa-member-card-star .ui-icon {
  width: 11px !important;
  height: 11px !important;
  font-size: 11px !important;
  color: #fff !important;
}

.equipa-member-card-star.rank-1 .ui-icon,
.equipa-member-card-star.rank-2 .ui-icon {
  width: 9px !important;
  height: 9px !important;
  font-size: 9px !important;
}

.equipa-member-card-antiguidade {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -45%);
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: var(--green, #2d9c48);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  box-shadow: 0 1px 4px rgba(25, 24, 71, 0.28);
  pointer-events: none;
  line-height: 1;
}

.equipa-member-card-antiguidade.rank-1 {
  background: linear-gradient(180deg, #f0c84a 0%, #d4a017 100%);
}

.equipa-member-card-antiguidade.rank-2 {
  background: linear-gradient(180deg, #c5ced8 0%, #7b8798 100%);
}

.equipa-member-card-antiguidade.rank-3 {
  background: linear-gradient(180deg, #d4a574 0%, #b0703a 100%);
}

.equipa-member-card-antiguidade .ui-icon {
  width: 10px !important;
  height: 10px !important;
  font-size: 10px !important;
  color: #fff !important;
}

.equipa-member-card-ms-photo-mark {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: #c45c26;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  box-shadow: 0 1px 4px rgba(25, 24, 71, 0.28);
  pointer-events: none;
  line-height: 1;
}

.equipa-member-card-ms-photo-mark .ui-icon {
  width: 10px !important;
  height: 10px !important;
  font-size: 10px !important;
  color: #fff !important;
}

.equipa-member-card-name {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.15rem;
  color: var(--navy);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipa-member-card-role {
  font-size: 0.6875rem;
  color: var(--gray-600);
  line-height: 1.3;
  margin-bottom: 0.15rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipa-member-card-meta {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 0.15rem;
}

.equipa-member-card-back-copy {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-width: 0;
  width: 58%;
  max-width: 6.4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0.55rem 0.2rem 0.55rem 0.5rem;
  text-align: left;
}

.equipa-member-card-perfil-img {
  position: absolute;
  right: -36px;
  bottom: 0;
  height: 118%;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: bottom right;
  image-rendering: auto;
  z-index: 4;
  pointer-events: none;
  user-select: none;
}

.equipa-member-card-back-name {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.equipa-member-card-back-role {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 0.5rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.equipa-member-card-back-fields {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.4rem 0 0.2rem;
  background: transparent;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.ui-tooltip-host {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  width: auto;
  max-width: 100%;
  vertical-align: middle;
}

.ui-tooltip {
  position: fixed;
  z-index: 12000;
  transform: translate(-50%, -100%);
  padding: 0.38rem 0.6rem;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--green);
  box-shadow: 0 8px 22px rgba(25, 24, 71, 0.18);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  animation: ui-tooltip-in 0.16s ease;
}

.ui-tooltip.place-below {
  transform: translate(-50%, 0);
}

.ui-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  background: #fff;
  border-right: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  transform: translateX(-50%) rotate(45deg);
}

.ui-tooltip.place-below::after {
  top: -5px;
  bottom: auto;
  border: 1px solid var(--gray-200);
  border-right: none;
  border-bottom: none;
}

@keyframes ui-tooltip-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.equipa-member-card-back-tip {
  width: 100%;
}

.equipa-member-card-back-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  width: 100%;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 0.55rem;
  line-height: 1.2;
}

a.equipa-member-card-back-row:hover {
  color: #fff;
}

.equipa-member-card-back-ico {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.equipa-member-card-back-value {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.5rem;
  letter-spacing: -0.01em;
}

.equipa-member-card-back-actions {
  position: absolute;
  left: 0.5rem;
  bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0;
  background: transparent;
  flex-shrink: 0;
  z-index: 5;
}

.equipa-member-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.45rem;
  min-height: 28px;
}
.equipa-member-row-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.equipa-member-row-ico:hover {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-muted);
}

.equipa-member-row-ico.on-dark {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.equipa-member-row-ico.on-dark:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.equipa-member-row-ico.is-check {
  border-color: transparent;
  background: var(--green);
  color: var(--white);
  cursor: default;
}

.equipa-member-row-ico:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .equipa-location-rail {
    justify-content: center;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
    gap: 0;
  }

  .equipa-location-orbit {
    --hub: 64px;
    --sat: 56px;
    --orbit: 104px;
    --hub-top: 2.9rem;
    width: min(100%, 19rem);
    height: 13rem;
  }

  .equipa-location-rail-locals .equipa-location-node:nth-child(3) { --orbit: 98px; }

  .equipa-location-node {
    margin-left: 0;
    min-width: 4rem;
    max-width: 4.8rem;
  }

  .equipa-location-node.is-direcao {
    min-width: 4.8rem;
    max-width: 5.8rem;
  }

  .equipa-location-media {
    width: var(--sat, 48px);
    height: var(--sat, 48px);
    min-height: 0;
    border-radius: 50%;
  }

  .equipa-location-node.is-direcao .equipa-location-media {
    width: var(--hub, 64px);
    height: var(--hub, 64px);
    min-height: 0;
    border-radius: 50%;
  }

  .equipa-location-director {
    width: 26px;
    height: 26px;
    right: -3px;
    bottom: -3px;
  }

  .equipa-location-node.is-direcao .equipa-location-director {
    width: 30px;
    height: 30px;
  }

  .equipa-member-card {
    width: 148px;
    min-height: 188px;
    height: 188px;
  }
}

.consultor-card {
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 0;
  text-align: center;
  color: var(--navy);
  position: relative;
  min-height: 220px;
  display: block;
  perspective: 1100px;
  box-shadow: none;
  animation: equipa-card-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  cursor: pointer;
}

.consultor-card-inner {
  position: relative;
  width: 100%;
  min-height: 220px;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.consultor-card.is-flipped .consultor-card-inner {
  transform: rotateY(180deg);
}

.consultor-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.15rem;
  padding: 1.25rem 0.875rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(25, 24, 71, 0.05);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  transition: box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.consultor-card-front {
  transform: rotateY(0deg);
}

.consultor-card-back {
  transform: rotateY(180deg);
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.45rem;
  padding: 0.7rem 0.65rem 0.6rem;
  background: var(--primary-1);
  border-color: var(--primary-1);
  color: #fff;
  overflow: hidden;
}

.consultor-card-back-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.consultor-card-back-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.15rem;
  padding-top: 0.1rem;
}

.consultor-card-back .consultor-card-name,
.consultor-card-back .consultor-card-name-sm {
  color: #fff;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  line-height: 1.2;
  text-align: left;
}

.consultor-card-back-role {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.65);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.consultor-card-back-fields {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
  min-height: 0;
  flex: 1;
  margin: 0;
  padding: 0.4rem 0.45rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  justify-content: center;
}

.consultor-card-back-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}

.consultor-card-back-ico {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 156, 72, 0.22);
  color: var(--primary-2, #2D9C48);
}

.consultor-card-back-value {
  flex: 1;
  min-width: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.consultor-card-back-value a,
a.consultor-card-back-value {
  color: var(--primary-4, #53AF3B);
  text-decoration: none;
}

.consultor-card-back-value a:hover,
a.consultor-card-back-value:hover {
  text-decoration: underline;
  color: #fff;
}

.consultor-card-back-email {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.consultor-card-back-local {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.consultor-card-viewas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: auto;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--ds-border);
  border-radius: 999px;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  width: calc(100% - 0.5rem);
  max-width: 160px;
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.consultor-card-viewas-btn:hover:not(:disabled) {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.consultor-card-viewas-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.consultor-table-viewas {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
}

.consultor-card.selectable:hover:not(.is-flipped) .consultor-card-front {
  box-shadow: 0 14px 32px rgba(25, 24, 71, 0.1);
  border-color: rgba(45, 156, 72, 0.35);
}

.consultor-card-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--primary-2), 0 6px 16px rgba(25, 24, 71, 0.1);
  margin: 0 auto 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}

/* Back-face avatar: keep a true circle (base rule is 76×76 and would stretch to an oval). */
.consultor-card-avatar.consultor-card-avatar-back {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(45, 156, 72, 0.85), 0 4px 10px rgba(0, 0, 0, 0.22);
  transform: none;
}

.consultor-card:hover:not(.is-flipped) .consultor-card-avatar {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px var(--primary-2), 0 10px 22px rgba(45, 156, 72, 0.18);
}

.consultor-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.consultor-card-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(45, 156, 72, 0.16), rgba(25, 24, 71, 0.08));
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.02em;
  user-select: none;
}

.consultor-card-name {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

.consultor-card-name-sm {
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

.consultor-card-role {
  font-size: 0.75rem;
  color: var(--gray-600);
  line-height: 1.3;
}

.consultor-card-email {
  margin-top: 0.15rem;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--gray-500);
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consultor-card-meta {
  margin-top: 0.2rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--primary-2);
}

.consultor-card-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.45rem;
  width: 100%;
  padding: 0 0.25rem;
}

.consultor-card-detail {
  font-size: 0.6875rem;
  color: var(--gray-600);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consultor-card-check {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(45, 156, 72, 0.35);
  z-index: 1;
}

.consultor-card.selected .consultor-card-front,
.consultor-card.selected .consultor-card-back {
  outline: none;
  border-color: var(--primary-2);
  box-shadow:
    0 0 0 2px rgba(45, 156, 72, 0.18),
    0 12px 28px rgba(45, 156, 72, 0.14);
}

.consultor-card.selected .consultor-card-back {
  background: var(--primary-1);
  border-color: var(--primary-2);
}

.consultor-card.selected .consultor-card-avatar {
  box-shadow: 0 0 0 3px var(--primary-2), 0 8px 18px rgba(45, 156, 72, 0.22);
}

.consultor-card.selected .consultor-card-viewas-btn {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(45, 156, 72, 0.25);
}

.consultor-card.selected.selectable:hover .consultor-card-back {
  border-color: var(--green-dark);
  box-shadow:
    0 0 0 2px rgba(45, 156, 72, 0.22),
    0 16px 32px rgba(45, 156, 72, 0.18);
}

.equipa-table-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--green);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-200);
}

.equipa-table-avatar .consultor-card-photo {
  width: 40px;
  height: 40px;
}

.equipa-enteras-btn {
  flex-shrink: 0;
  padding: 0.5rem 0.65rem;
  min-width: auto;
}

.equipa-stats {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--gray-600);
}

/* ── Module cards (Dribbble-style panels) ── */
.module-card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--card-radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-card);
}

.module-card-tabs {
  padding: 0.45rem 0.55rem;
  display: flex;
  align-items: center;
}

.module-card-table {
  padding: 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.module-card-table .data-table-wrap {
  border: none;
  border-radius: 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.module-tabs {
  margin-bottom: 0;
  background: transparent;
  border: none;
  padding: 0;
}

/* Segmented tab control (Mediação / module sections) */
.tabs-segmented {
  display: inline-flex;
  align-items: stretch;
  gap: 0.2rem;
  margin-bottom: 0;
  padding: 0.2rem;
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: 10px;
  background: var(--gray-100, #f3f4f6);
  box-shadow: inset 0 1px 1px rgba(25, 24, 71, 0.04);
}

.tabs-segmented .tab {
  margin: 0;
  padding: 0.45rem 1rem;
  border: none;
  border-bottom: none;
  border-radius: 8px;
  background: transparent;
  color: var(--gray-600);
  font-weight: 550;
  font-size: 0.8125rem;
  line-height: 1.2;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.tabs-segmented .tab:hover:not(:disabled):not(.active) {
  color: var(--brand-navy);
  background: rgba(255, 255, 255, 0.7);
}

.tabs-segmented .tab.active {
  color: #fff;
  background: var(--accent);
  border-bottom-color: transparent;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(25, 24, 71, 0.12);
}

.tabs-segmented .tab.active:hover:not(:disabled) {
  color: #fff;
  background: var(--green-dark);
}

.equipa-toolbar-card .equipa-search-bar,
.mediacao-toolbar-card .mediacao-toolbar,
.module-page-shell-toolbar .mediacao-toolbar,
.module-page-shell-toolbar .equipa-shell-toolbar {
  margin-bottom: 0;
  background: transparent;
  border: none;
  padding: 0;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.module-page-shell-toolbar .toolbar-filters,
.mediacao-toolbar-card .toolbar-filters {
  width: auto;
  max-width: 100%;
  flex: 1 1 12rem;
  min-width: 0;
}

.module-page-shell-toolbar .toolbar-actions,
.mediacao-toolbar-card .toolbar-actions {
  width: auto;
  max-width: 100%;
  flex: 1 1 12rem;
  min-width: 0;
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.equipa-search-bar input {
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}

.equipa-search-bar select {
  flex: 0 0 auto;
  min-width: 120px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  background: var(--white);
  color: var(--navy);
}

.equipa-search-bar select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green-muted);
}

.equipa-search-bar input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green-muted);
}

.empty-hint {
  grid-column: 1 / -1;
  color: var(--gray-600);
  font-size: 0.8125rem;
  padding: 1rem 0;
}

.mediacao-layout .content-main {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

/* Reusable list-page template: one rounded shell for tabs + toolbar + table */
.module-page-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: var(--card-radius, 12px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.module-page-shell-tabs {
  flex: 0 0 auto;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--ds-border, var(--gray-200));
  background: var(--ds-surface, #fff);
}

.module-page-shell-toolbar {
  flex: 0 0 auto;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--ds-border, var(--gray-200));
  background: var(--ds-surface, #fff);
}

.module-page-shell-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.85rem 0.85rem;
  background: var(--ds-surface-muted, #f3f4f6);
  gap: 0;
}

.comissao-wallet {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.comissao-wallet-caption {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-navy, #1F2C5C);
}

.comissao-wallet-caption span {
  font-weight: 600;
  color: var(--ds-text-muted, #6b7280);
  text-transform: none;
  letter-spacing: 0;
}

.comissao-wallet-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.comissao-wallet-row.is-admin {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.comissao-wallet-card.dashboard-widget-card,
.comissao-wallet-card.dash-card-v2 {
  min-height: 8.5rem;
  height: auto;
  cursor: pointer;
  overflow: visible;
  container-type: inline-size;
}

.comissao-wallet-card.is-active {
  border-color: var(--green, #2D9C48);
}

.comissao-wallet-card .dash-card-v2-body,
.comissao-wallet-card .kpi-card-v2-body {
  align-items: flex-start;
  text-align: left;
  padding: 0.15rem 0 0;
  overflow: visible;
  min-height: auto;
  flex: 1 1 auto;
}

.comissao-wallet-card .dash-card-v2-explore {
  justify-content: flex-end;
  padding-top: 0.35rem;
}

.comissao-wallet-card.is-title-compact .dash-card-v2-explore {
  justify-content: flex-end;
}

.comissao-wallet-card .kpi-card-v2-value {
  font-size: clamp(0.95rem, 2.2vw, 1.35rem);
}

.comissao-wallet-card .kpi-trend {
  margin: 0.15rem 0 0;
}

.comissao-wallet-mix {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.2rem 0.1rem 0.05rem;
}

.comissao-wallet-mix-row {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.comissao-wallet-mix-row > .ui-tooltip-host {
  display: block;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.comissao-wallet-mix-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-navy, #1F2C5C);
}

.comissao-wallet-mix-total {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--brand-navy, #1F2C5C);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.comissao-wallet-track {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  height: 1.85rem;
  min-width: 0;
  background: rgba(31, 44, 92, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.comissao-wallet-track.is-active {
  box-shadow: 0 0 0 1px var(--green, #2D9C48);
}

.comissao-wallet-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 0.45rem;
  border: 0;
  border-radius: 0;
  background: #1F2C5C;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.comissao-wallet-seg:first-child {
  border-radius: 999px 0 0 999px;
}

.comissao-wallet-seg:last-child {
  border-radius: 0 999px 999px 0;
}

.comissao-wallet-seg:only-child {
  border-radius: 999px;
}

.comissao-wallet-seg.is-green {
  background: #2D9C48;
}

.comissao-wallet-seg.is-navy {
  background: #1F2C5C;
}

.comissao-wallet-seg.is-active {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.95);
}

.comissao-wallet-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-navy, #1F2C5C);
}

.comissao-wallet-bar-legend em {
  font-style: normal;
  color: var(--ds-text-muted, #6b7280);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .comissao-wallet-mix-row {
    grid-template-columns: 4.6rem minmax(0, 1fr);
  }
  .comissao-wallet-mix-total {
    display: none;
  }
  .comissao-wallet-seg {
    font-size: 0.625rem;
    padding: 0 0.4rem;
  }
}

@media (max-width: 900px) {
  .comissao-wallet-row,
  .comissao-wallet-row.is-admin {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .comissao-wallet-row,
  .comissao-wallet-row.is-admin {
    grid-template-columns: 1fr;
  }
}

.list-totals-cards {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.list-totals-cards.n-1 {
  grid-template-columns: 1fr;
}

.list-totals-cards.n-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.list-totals-cards.n-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.list-totals-card.dash-card-v2,
.list-totals-card.dashboard-widget-card {
  container-type: normal;
  min-height: 5.75rem;
  height: auto;
  padding: 0.85rem 1rem;
  cursor: default;
  overflow: visible;
}

.list-totals-cards > .ui-tooltip-host {
  display: flex;
  width: 100%;
  max-width: none;
  min-width: 0;
  align-items: stretch;
}

.list-totals-cards > .ui-tooltip-host > .list-totals-card {
  width: 100%;
  flex: 1;
}

.list-totals-card.is-active {
  border-color: var(--accent, #2D9C48);
}

@keyframes list-totals-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(45, 156, 72, 0.22), 0 8px 18px rgba(45, 156, 72, 0.16);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(45, 156, 72, 0.12), 0 10px 22px rgba(45, 156, 72, 0.28);
  }
}

.list-totals-card.is-glow {
  border-color: var(--accent, #2D9C48);
  animation: list-totals-glow 1.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .list-totals-card.is-glow {
    animation: none;
    box-shadow: 0 0 0 3px rgba(45, 156, 72, 0.18), 0 8px 18px rgba(45, 156, 72, 0.16);
  }
}

.list-totals-card .dash-card-v2-head {
  flex-shrink: 0;
  padding: 0 0 0.35rem;
  overflow: visible;
}

.list-totals-card .dash-card-v2-body {
  min-height: auto;
  flex: 0 0 auto;
  overflow: visible;
  padding-top: 0.15rem;
}

.list-totals-card .kpi-card-v2-label,
.list-totals-card .dash-card-v2-head .kpi-card-v2-label {
  font-size: 0.625rem;
  white-space: normal;
  overflow: visible;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.list-totals-card .kpi-card-v2-value {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

@media (max-width: 720px) {
  .list-totals-cards,
  .list-totals-cards.n-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .list-totals-cards,
  .list-totals-cards.n-2,
  .list-totals-cards.n-4 {
    grid-template-columns: 1fr;
  }
}

.module-page-table {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: var(--card-radius, 12px);
  box-shadow: var(--shadow-card);
}

.module-page-table .data-grid,
.module-page-table .data-table-wrap {
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.module-page-table .pagination {
  flex: 0 0 auto;
  border-top: 1px solid var(--ds-border, var(--gray-200));
  padding: 0.55rem 0.85rem;
  background: #f3f4f6;
  border-radius: 0 0 calc(var(--card-radius, 12px) - 1px) calc(var(--card-radius, 12px) - 1px);
}

.module-page-shell-split > .module-page-shell-body {
  min-height: 0;
}

.generic-list-embedded {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.generic-list-embedded > .module-page-shell-toolbar {
  border-bottom: 1px solid var(--ds-border, var(--gray-200));
}

.page-content.faturacao-page {
  background: var(--ds-surface-muted, #efefef);
}

.page-body:has(.faturacao-page) {
  background: var(--ds-surface-muted, #efefef);
}

/* ── Commission ring (sidebar profile) ── */
.commission-ring-svg {
  display: block;
}

.toolbar-spacer { flex: 1; }

.toolbar-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gray-300);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-icon-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ── Negócio floating modal (create / edit) ── */
.negocio-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(25, 24, 71, 0.52);
  backdrop-filter: blur(4px);
  animation: negocio-modal-fade 0.18s ease;
}

.negocio-modal {
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(25, 24, 71, 0.28);
  overflow: hidden;
  animation: negocio-modal-rise 0.22s ease;
}

.negocio-modal-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
}

.negocio-modal > .negocio-modal-panel {
  flex: 1;
}

.negocio-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem 1rem;
  background: linear-gradient(135deg, var(--primary-1) 0%, var(--primary-3) 100%);
  color: var(--white);
}

.negocio-modal-header h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--white);
  letter-spacing: -0.01em;
}

.negocio-modal-subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.8125rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
}

.negocio-modal-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.negocio-modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.negocio-modal-body {
  padding: 1.25rem 1.35rem 0.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.negocio-modal-body .form-group {
  margin-bottom: 1rem;
}

.negocio-modal-body .form-group label {
  color: var(--navy);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.negocio-modal-body .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.negocio-modal-body .form-group select {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border-color: var(--gray-300);
  background: var(--white);
  font-size: 0.875rem;
  color: var(--navy);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.negocio-modal-body .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
.negocio-modal-body .form-group select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-muted);
  outline: none;
}

.negocio-modal-body .form-group input.is-invalid,
.negocio-modal-body .form-group input[aria-invalid="true"] {
  border-color: var(--color-error);
}

.negocio-modal-body .form-group input.is-invalid:focus,
.negocio-modal-body .form-group input[aria-invalid="true"]:focus {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(193, 60, 60, 0.16);
}

.negocio-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--gray-100);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
}

.segmented-option {
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.55rem 0.35rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.segmented-option:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.7);
}

.segmented-option.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(25, 24, 71, 0.12);
}

.negocio-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
  padding: 1rem 1.35rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  background: linear-gradient(180deg, #fafbfc 0%, var(--white) 100%);
}

.negocio-modal-footer .btn {
  min-width: 6.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
}

.negocio-modal-footer .btn-primary {
  background: var(--green);
  border-color: var(--green);
}

.negocio-modal-footer .btn-primary:hover:not(:disabled) {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.raw-inspect-modal {
  width: min(720px, 94vw);
  max-height: min(85vh, 900px);
}

.raw-inspect-pre {
  margin: 0;
  padding: 0.75rem 1rem;
  max-height: min(60vh, 560px);
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.negocio-modal-grid-auto {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

.negocio-modal-grid-auto .form-group-full {
  grid-column: 1 / -1;
}

.negocio-modal-readonly {
  font-size: 0.875rem;
  padding: 0.45rem 0;
  color: var(--navy);
}

@media (max-width: 560px) {
  .negocio-modal-grid-auto {
    grid-template-columns: 1fr;
  }
}

@keyframes negocio-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes negocio-modal-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 560px) {
  .negocio-modal-grid {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    grid-template-columns: 1fr;
  }

  .negocio-modal-footer {
    flex-direction: column-reverse;
  }

  .negocio-modal-footer .btn {
    width: 100%;
  }
}

/* Legacy drawer class kept inert if referenced elsewhere */
.update-drawer {
  display: none;
}

.dashboard-content {
  flex-direction: column;
  gap: 1.5rem;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--ds-card-gap, 0.875rem);
  flex-shrink: 0;
}

.kpi-card {
  background: var(--ds-surface, var(--white));
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: var(--card-radius);
  padding: 1.125rem var(--ds-content-pad);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.kpi-card:hover {
  box-shadow: 0 8px 24px rgba(25, 24, 71, 0.08);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ds-text-muted, var(--gray-600));
  font-size: 0.75rem;
  font-weight: 600;
}

.kpi-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--green-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-2);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ds-text-muted, var(--gray-600));
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.profile-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gray-200);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.profile-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.profile-email {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.profile-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.role-badge, .tag-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #ecfccb;
  color: #3f6212;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-perms {
  font-size: 0.8rem;
  color: var(--gray-600);
}

/* Sidebar search removed */

.user-email-line {
  font-size: 0.625rem;
  color: var(--gray-400);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.25rem;
}

/* Dashboard v2 layout */
.page-body:has(.dashboard-v2-layout) {
  margin: 0;
  padding: 0;
  background: transparent;
}

.app-panel > .main:has(.dashboard-v2-layout),
.main:has(.dashboard-v2-layout) {
  --dashboard-h-tile: calc(38.5px * 0.45 * 1.7);
  --dashboard-h-ox: calc(var(--dashboard-h-tile) / 2);
  --dashboard-pattern-h: #efefef;
  background: var(--ds-surface-muted, var(--gray-100));
  position: relative;
  isolation: isolate;
}

.app-panel > .main:has(.dashboard-v2-layout)::before,
.main:has(.dashboard-v2-layout)::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--dashboard-pattern-h);
  -webkit-mask-image: url('/images/pattern-h.svg'), url('/images/pattern-h.svg');
  mask-image: url('/images/pattern-h.svg'), url('/images/pattern-h.svg');
  -webkit-mask-size: var(--dashboard-h-tile) var(--dashboard-h-tile), var(--dashboard-h-tile) var(--dashboard-h-tile);
  mask-size: var(--dashboard-h-tile) var(--dashboard-h-tile), var(--dashboard-h-tile) var(--dashboard-h-tile);
  -webkit-mask-position: 0 0, var(--dashboard-h-ox) var(--dashboard-h-ox);
  mask-position: 0 0, var(--dashboard-h-ox) var(--dashboard-h-ox);
  -webkit-mask-repeat: repeat, repeat;
  mask-repeat: repeat, repeat;
  pointer-events: none;
}

.app-panel > .main:has(.dashboard-v2-layout) > *,
.main:has(.dashboard-v2-layout) > * {
  position: relative;
  z-index: 1;
}

.app-panel > .main:has(.dashboard-v2-layout) > .topbar,
.main:has(.dashboard-v2-layout) > .topbar {
  z-index: 30;
  overflow: visible;
}

.app-panel > .main:has(.dashboard-v2-layout) > .avaliacao-fab,
.main:has(.dashboard-v2-layout) > .avaliacao-fab {
  position: fixed;
  z-index: 80;
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  top: auto;
  left: auto;
  right: 1.5rem;
  bottom: 1.5rem;
  align-self: flex-end;
}

.dashboard-v2-layout {
  --dashboard-h-tile: calc(38.5px * 0.45 * 1.7);
  --dashboard-h-ox: calc(var(--dashboard-h-tile) / 2);
  --dashboard-pattern-h: #efefef;
  display: flex;
  flex-direction: column;
  gap: var(--ds-card-gap);
  margin: 0;
  padding: var(--ds-content-pad, 20px);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: transparent;
  position: relative;
  isolation: isolate;
}

.dashboard-v2-layout::before {
  display: none;
}

.dashboard-v2-layout > * {
  position: relative;
  z-index: 1;
}

.dashboard-v2-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--ds-card-gap);
  margin: 0;
  padding: 0;
}

.dashboard-edit-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  background: var(--ds-surface);
  border: 1px dashed var(--brand-green, #2d8a4e);
  border-radius: 10px;
  font-size: 0.8125rem;
  color: var(--gray-700);
}

.dashboard-edit-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.dashboard-phone-admin-bar {
  display: flex;
  justify-content: flex-end;
}

.dashboard-add-widgets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-add-widgets > span {
  font-weight: 600;
  color: var(--text);
}

.dashboard-widget-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--ds-card-gap);
  width: 100%;
  position: relative;
}

.dashboard-widget-grid-editing {
  --dash-chrome-h: 2.15rem;
  background-image:
    linear-gradient(to right, rgba(45, 138, 78, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(45, 138, 78, 0.08) 1px, transparent 1px);
  background-size: calc((100% - 11 * var(--ds-card-gap)) / 12 + var(--ds-card-gap)) var(--dash-row-height, 36px);
  border-radius: 10px;
  padding: 2px;
  column-gap: var(--ds-card-gap);
  row-gap: var(--ds-card-gap);
}

.dashboard-widget {
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.dashboard-widget-editing {
  outline: 2px dashed rgba(45, 138, 78, 0.45);
  outline-offset: -2px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
  cursor: grab;
  user-select: none;
}

.dashboard-widget-grid-editing .dashboard-widget-content {
  pointer-events: none;
}

.dashboard-widget-content.is-widget-locked {
  filter: blur(4px);
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
}

.dashboard-widget-dragging {
  z-index: 5;
  transition: none;
  outline-color: var(--brand-green, #2d8a4e);
  box-shadow: 0 10px 28px rgba(25, 24, 71, 0.16);
  cursor: grabbing;
}

.dashboard-widget-chrome {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.45rem;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-bottom: 1px solid var(--ds-border);
  border-radius: 12px 12px 0 0;
  font-size: 0.75rem;
  z-index: 4;
  box-sizing: border-box;
  min-height: var(--dash-chrome-h, 2.15rem);
}

.dashboard-widget-label {
  flex: 1;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--brand-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-widget-drag,
.dashboard-widget-remove,
.dashboard-widget-move {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--gray-600);
  cursor: grab;
}

.dashboard-widget-move {
  cursor: pointer;
}

.dashboard-widget-move:disabled {
  opacity: 0.35;
  cursor: default;
}

.dashboard-widget-drag {
  touch-action: none;
}

.dashboard-widget-inspect-chrome {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
}

.dashboard-widget-inspect-chrome:hover,
.dashboard-widget-move:hover:not(:disabled) {
  background: rgba(45, 156, 72, 0.08);
  color: var(--primary-2);
}

.dashboard-widget-drag:active {
  cursor: grabbing;
}

.dashboard-widget-remove:hover {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

.dashboard-widget-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-widget-content > .kpi-card-v2,
.dashboard-widget-content > .ds-card,
.dashboard-widget-content > .dash-card-v2 {
  height: 100%;
  min-height: 0;
}

.dashboard-widget-card {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  container-type: size;
  container-name: dash-card;
}

.dashboard-widget-card .ds-card-head {
  padding: clamp(0.55rem, 1.1cqi + 1.6cqh, 1.125rem) clamp(0.65rem, 2.4cqi, 1.125rem) clamp(0.35rem, 0.6cqi + 1.1cqh, 0.75rem);
  gap: clamp(0.3rem, 1.2cqi, 0.75rem);
}

.dashboard-widget-card .ds-card-head h3,
.dashboard-widget-card .chart-card-title,
.dashboard-widget-card .kpi-card-v2-head {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

.dashboard-widget-card .ds-card-head > .kpi-card-v2-head,
.dashboard-widget-card .chart-card-header > .kpi-card-v2-head,
.dashboard-widget-card .chart-card-header-main > .kpi-card-v2-head,
.dashboard-widget-card .pipeline-card-head-main > .kpi-card-v2-head {
  width: auto;
  flex: 1;
  min-width: 0;
}

.dashboard-widget-card .kpi-card-v2-label {
  min-width: 0;
}

.dashboard-widget-card .dash-card-head-icon,
.kpi-card-v2-head .dash-card-head-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.dashboard-widget-card .dash-card-head-icon .ui-icon,
.kpi-card-v2-head .dash-card-head-icon .ui-icon {
  width: 16px !important;
  height: 16px !important;
  font-size: 16px !important;
}

.dashboard-widget-card .pipeline-filter-summary,
.dashboard-widget-card .dash-stat-meta,
.dashboard-widget-card .empty-hint,
.dashboard-widget-card .dash-bar-legend,
.dashboard-widget-card .mix-vbar-meta,
.dashboard-widget-card .soi-status-pill {
  font-size: clamp(0.58rem, 0.46rem + 0.85cqi + 0.4cqh, 0.75rem);
}

.dashboard-widget-card .dash-bar-label,
.dashboard-widget-card .dash-bar-value,
.dashboard-widget-card .mix-vbar-label,
.dashboard-widget-card .mix-row-fig,
.dashboard-widget-card .dash-faturacao-pie-amt,
.dashboard-widget-card .ds-card-filter {
  font-size: clamp(0.62rem, 0.5rem + 1.05cqi + 0.45cqh, 0.84rem);
}

.dashboard-widget-card .dash-faturacao-pie-name {
  font-size: clamp(0.6875rem, 0.55rem + 0.7cqi + 0.3cqh, 0.75rem);
}

.dashboard-widget-card .dash-stat-hero,
.dashboard-widget-card .dash-faturacao-card .dash-stat-hero {
  font-size: clamp(0.95rem, 0.7rem + 2.2cqi + 1.3cqh, 1.6rem) !important;
}

.dashboard-widget-card .comissao-dash-metrics strong {
  font-size: clamp(0.75rem, 0.58rem + 1.4cqi + 0.8cqh, 1.05rem);
}

.dashboard-widget-card .perfil-metric-label,
.dashboard-widget-card .comissao-dash-card .perfil-hint,
.dashboard-widget-card .activity-list,
.dashboard-widget-card .leaderboard-name,
.dashboard-widget-card .leaderboard-sum {
  font-size: clamp(0.62rem, 0.5rem + 0.95cqi + 0.4cqh, 0.82rem);
}

.dashboard-widget-card .pipeline-board {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-widget-card .pipeline-kanban,
.dashboard-widget-card .activity-list,
.dashboard-widget-card .challenge-list,
.dashboard-widget-card .leaderboard-list,
.dashboard-widget-card .soi-score-body,
.dashboard-widget-card .progress-card-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.dashboard-widget-card .soi-card-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dashboard-widget-card .comissao-dash-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dashboard-widget-card .pipeline-kanban {
  min-height: 0;
  padding-bottom: clamp(0.15rem, 1.2cqh, 0.6rem);
  gap: clamp(0.4rem, 1.6cqi, 0.75rem);
}

.dashboard-widget-card .pipeline-column {
  min-width: min(7.5rem, 100%);
  padding: clamp(0.35rem, 1.8cqi, 0.75rem);
}

.dashboard-widget-card .progress-ring,
.dashboard-widget-card .progress-ring-svg-wrap {
  width: clamp(40px, 18cqi + 8cqh, 72px);
  height: clamp(40px, 18cqi + 8cqh, 72px);
}

.dashboard-widget-card .soi-activation-ring {
  width: clamp(44px, 16cqi + 6cqh, 72px);
  height: clamp(44px, 16cqi + 6cqh, 72px);
}

.dashboard-widget-card .soi-activation-core {
  width: 74%;
  height: 74%;
}

@container dash-card (max-width: 13rem) {
  .progress-ring-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .soi-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "ring"
      "copy"
      "insight";
    justify-items: start;
  }
  .mix-vbar-legend,
  .dash-bar-legend {
    display: none;
  }
}

@container dash-card (max-height: 7.5rem) {
  .dash-stat-meta,
  .dash-stat-consultor,
  .pipeline-filter-summary {
    display: none;
  }
}

.dashboard-widget-resize {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-right: 2px solid var(--brand-green, #2d8a4e);
  border-bottom: 2px solid var(--brand-green, #2d8a4e);
  background: transparent;
  cursor: nwse-resize;
  z-index: 30;
  padding: 0;
  touch-action: none;
}

.dashboard-widget-resize::after {
  content: '';
  position: absolute;
  inset: -6px;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--ds-card-gap);
  align-items: start;
  width: 100%;
  flex-shrink: 0;
}

.dashboard-main-grid > .ds-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: min(520px, 55vh);
  overflow: hidden;
}

.pipeline-kanban {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 1.125rem 1rem;
  flex: 1;
  min-height: 200px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

.pipeline-column {
  flex: 1 1 0;
  min-width: 180px;
  background: var(--ds-surface-muted);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.pipeline-estado-pills {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  margin: 0 0.85rem 0.4rem;
  padding: 0.12rem;
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: 999px;
  background: var(--gray-100, #f3f4f6);
  flex-shrink: 0;
}

.pipeline-estado-pills button {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--gray-600);
  font-size: 0.625rem;
  font-weight: 650;
  line-height: 1.1;
  padding: 0.28rem 0.3rem;
  cursor: pointer;
  min-height: 26px;
}

.pipeline-estado-pills button:hover:not(.active) {
  color: var(--brand-navy);
  background: rgba(255, 255, 255, 0.75);
}

.pipeline-estado-pills button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(25, 24, 71, 0.12);
}

.pipeline-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-pill-count {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

.dashboard-widget-card .pipeline-board.is-compact .pipeline-kanban,
.pipeline-board.is-compact .pipeline-kanban {
  overflow: hidden;
  padding-top: 0;
}

.pipeline-board.is-compact .pipeline-column {
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
}

.dashboard-side-col {
  display: flex;
  flex-direction: column;
  gap: var(--ds-card-gap);
  min-width: 0;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ds-card-gap);
  width: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.dashboard-greeting h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: -0.025em;
}

.dashboard-greeting p {
  font-size: 0.8125rem;
  color: var(--ds-text-muted);
  margin-top: 0.3rem;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dashboard-header-actions:has(.dashboard-period-filters) .dashboard-date {
  display: none;
}

/* Global toast notifications (top-right) */
.toast-host {
  position: fixed;
  top: var(--toast-top, calc(var(--shell-padding, 12px) + 5.75rem));
  right: 1rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  background: var(--ds-surface, #fff);
  color: var(--brand-navy, #191847);
  border: 1px solid var(--ds-border, #E2E6EE);
  box-shadow: 0 10px 28px rgba(25, 24, 71, 0.16);
  border-left: 4px solid var(--color-info, #3B6BD4);
  animation: toast-in 0.22s ease;
}

.toast.is-leaving {
  animation: toast-out 0.2s ease forwards;
}

.toast-success { border-left-color: var(--color-success, #2D9C48); }
.toast-error { border-left-color: var(--color-error, #C13C3C); }
.toast-warning { border-left-color: var(--color-warning, #F2C94C); }
.toast-info { border-left-color: var(--color-info, #3B6BD4); }

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.toast-success .toast-icon {
  color: var(--color-success, #2D9C48);
  background: rgba(45, 156, 72, 0.12);
}

.toast-error .toast-icon {
  color: var(--color-error, #C13C3C);
  background: rgba(193, 60, 60, 0.1);
}

.toast-warning .toast-icon {
  color: #b45309;
  background: rgba(242, 201, 76, 0.22);
}

.toast-info .toast-icon {
  color: var(--color-info, #3B6BD4);
  background: rgba(59, 107, 212, 0.12);
}

.toast-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toast-kicker,
.toast-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-600, #5b6b7c);
}

.toast-message {
  font-size: 0.8125rem;
  font-weight: 550;
  line-height: 1.35;
  color: var(--text, #152033);
  overflow-wrap: anywhere;
}

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.15rem -0.1rem 0 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--gray-600, #5b6b7c);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(25, 24, 71, 0.06);
  color: var(--brand-navy, #191847);
}

.toast.is-permanent .toast-close {
  color: var(--brand-navy, #191847);
}

.release-notes-dialog {
  width: min(520px, 100%);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
}

.release-notes-date {
  margin: -0.15rem 0 0.65rem !important;
  font-size: 0.75rem !important;
  font-weight: 600;
  color: var(--brand-green, #2d8a4e) !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.release-notes-body {
  margin: 0.85rem 0 1rem;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 0.15rem;
}

.release-notes-section h4 {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--brand-navy, #191847);
}

.release-notes-section ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--gray-700, #3d4a5c);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.release-notes-section li + li {
  margin-top: 0.28rem;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}

.dashboard-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--gray-600);
  padding: 0.35rem 0.75rem;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: 999px;
}

.btn-primary-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}

.btn-primary-accent:hover {
  background: var(--primary-4);
}

.kpi-row-v2 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ds-card-gap);
}

.dash-card-v2,
.kpi-card-v2 {
  container-type: size;
  container-name: dash-card kpi-card;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--card-radius);
  padding: clamp(0.5rem, 4cqi, 1.125rem) clamp(0.5rem, 4cqi, var(--ds-content-pad));
  box-shadow: var(--shadow-card);
}

.dash-card-v2-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  flex-shrink: 0;
  min-width: 0;
  overflow: visible;
  padding: 0.15rem 0 0.55rem;
}

.dash-card-v2-head .kpi-card-v2-head {
  width: auto;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.dash-card-title-tip.ui-tooltip-host {
  display: inline-flex;
  width: auto;
  flex-shrink: 0;
  line-height: 0;
}

.dash-card-v2-head .kpi-card-v2-label,
.dashboard-widget-card .kpi-card-v2-label {
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  flex: 1 1 auto;
}

.dash-card-v2.is-title-compact .kpi-card-v2-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

@container dash-card (max-width: 10.5rem) {
  .dash-card-v2-head .kpi-card-v2-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
  }
}

.dash-card-v2-actions {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  overflow: visible;
}

.dash-card-v2-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dash-card-v2-explore {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding-top: clamp(0.15rem, 1.2cqh, 0.4rem);
  margin-top: auto;
}

.dash-card-v2.is-title-compact .dash-card-v2-explore:not(.has-period) {
  justify-content: center;
}

.dash-card-period-foot {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ds-text-muted, var(--gray-600));
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.dash-card-v2.is-title-compact .dash-card-v2-explore.has-period {
  justify-content: flex-end;
}

.dash-card-v2-body > * {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
}

.dash-card-v2-body > .empty-hint,
.dash-card-v2 .dash-bars > .empty-hint,
.dash-card-v2 .mix-vbar-body > .empty-hint,
.dash-card-v2 .dash-stat-card-body > .empty-hint,
.dash-card-v2 .comissao-dash-body > .empty-hint,
.dash-card-v2 .soi-card-body > .empty-hint {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem;
  align-self: stretch;
}

.dash-card-v2 .dash-count-grid,
.dash-card-v2 .dash-stat-card-body,
.dash-card-v2 .dash-faturacao-body,
.dash-card-v2 .mix-vbar-body,
.dash-card-v2 .comissao-dash-body,
.dash-card-v2 .comissao-dash-footer,
.dash-card-v2 .soi-card-body,
.dash-card-v2 .dash-bars,
.dash-card-v2 .progress-card-body,
.dash-card-v2 .pipeline-kanban,
.dash-card-v2 .empty-hint {
  padding-left: 0;
  padding-right: 0;
}

.dashboard-inspect-btn {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ds-border);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.dashboard-inspect-btn:hover {
  color: var(--navy);
  border-color: var(--green);
}

.ds-card-head .dashboard-inspect-btn,
.ds-card-head-actions .dashboard-inspect-btn {
  position: static;
}

.ds-card-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-inspect-modal {
  width: min(980px, 96vw);
  max-height: 92vh;
  background: var(--ds-surface-muted, #F2F4F8);
}

.dashboard-inspect-header {
  align-items: flex-start;
}

.dashboard-inspect-header-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.dashboard-inspect-header-copy h3 {
  margin: 0;
}

.dashboard-inspect-header-copy p {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 400;
}

.dashboard-inspect-kicker {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #2D9C48);
}

.dashboard-inspect-header .dashboard-inspect-kicker {
  color: rgba(255, 255, 255, 0.72);
}

.dashboard-inspect-close {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

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

.dashboard-inspect-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow: auto;
  max-height: calc(92vh - 108px);
  padding: 1rem 1.1rem 1.15rem;
  background: transparent;
}

.negocio-modal-body.dashboard-inspect-body {
  padding: 1rem 1.1rem 1.15rem;
}

.dashboard-inspect-section {
  margin: 0;
}

.dashboard-inspect-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.dashboard-inspect-section h4 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brand-navy, #191847);
}

.dashboard-inspect-section-sub {
  font-size: 0.75rem;
  color: var(--ds-text-muted, #5B6B7C);
}

.dashboard-inspect-filter-card {
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border, #E2E6EE);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dashboard-inspect-filter-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.dashboard-inspect-filter-title {
  margin: 0.2rem 0 0;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-navy, #191847);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.dashboard-inspect-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.dashboard-inspect-meta-chip {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--ds-surface-muted, #F2F4F8);
  border: 1px solid transparent;
  min-width: 0;
}

.dashboard-inspect-meta-chip-wide {
  grid-column: span 2;
}

.dashboard-inspect-meta-chip span {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-text-muted, #5B6B7C);
}

.dashboard-inspect-meta-chip strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #152033);
  overflow-wrap: anywhere;
}

.dashboard-inspect-note {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(45, 156, 72, 0.08);
  border: 1px solid rgba(45, 156, 72, 0.16);
  color: var(--ds-text-muted, #5B6B7C);
  font-size: 0.78rem;
  line-height: 1.4;
}

.dashboard-inspect-filter-editor {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--ds-border);
  border-radius: 12px;
  background: var(--ds-surface-muted, #F2F4F8);
}

.dashboard-inspect-filter-editor > label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--ds-text-muted);
}

.dashboard-inspect-filter-editor select {
  font-size: 0.8125rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--ds-border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.dashboard-inspect-estado-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.dashboard-inspect-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text);
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--ds-border);
}

.dashboard-inspect-filter-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dashboard-inspect-filter-hint,
.dashboard-inspect-filter-msg {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ds-text-muted);
}

.dashboard-inspect-filter-msg {
  color: var(--accent, #2D9C48);
}

.dashboard-inspect-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.dashboard-inspect-stat {
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border, #E2E6EE);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dashboard-inspect-stat span {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-text-muted, #5B6B7C);
}

.dashboard-inspect-stat strong {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand-navy, #191847);
  letter-spacing: -0.03em;
}

.dashboard-inspect-stat-accent {
  border-color: rgba(45, 156, 72, 0.28);
  background: linear-gradient(180deg, rgba(45, 156, 72, 0.08), #fff 55%);
}

.dashboard-inspect-stat-accent strong {
  color: var(--accent, #2D9C48);
}

.dashboard-inspect-dist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-inspect-dist li {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border);
  box-shadow: var(--shadow-card);
  font-size: 0.8125rem;
}

.dashboard-inspect-dist li strong {
  font-weight: 600;
  color: var(--brand-navy, #191847);
}

.dashboard-inspect-dist li span {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
  color: var(--text);
}

.dashboard-inspect-dist li.tone-open {
  border-color: var(--tone-em-curso-fg);
  background: var(--tone-em-curso-bg);
}

.dashboard-inspect-dist li.tone-won {
  border-color: var(--tone-concluido-fg);
  background: var(--tone-concluido-bg);
}

.dashboard-inspect-dist li.tone-lost {
  border-color: var(--tone-perdido-fg);
  background: var(--tone-perdido-bg);
}

.dashboard-inspect-table-shell {
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border, #E2E6EE);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dashboard-inspect-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: none;
  border-radius: 0;
}

.dashboard-inspect-table-wrap .data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.dashboard-inspect-table-wrap .data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dashboard-inspect-empty-cell {
  text-align: center;
  color: var(--ds-text-muted);
  padding: 1.25rem 0.75rem !important;
}

.dashboard-inspect-estado-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--ds-surface-muted);
  color: var(--text);
}

.dashboard-inspect-estado-pill.tone-open {
  background: var(--tone-em-curso-bg);
  color: var(--tone-em-curso-fg);
}

.dashboard-inspect-estado-pill.tone-won {
  background: var(--tone-concluido-bg);
  color: var(--tone-concluido-fg);
}

.dashboard-inspect-estado-pill.tone-lost {
  background: var(--tone-perdido-bg);
  color: var(--tone-perdido-fg);
}

.dashboard-inspect-pagination {
  border-top: 1px solid var(--ds-border);
  padding: 0.55rem 0.85rem;
  background: var(--ds-surface, #fff);
}

@media (max-width: 760px) {
  .dashboard-inspect-meta-grid,
  .dashboard-inspect-counts {
    grid-template-columns: 1fr;
  }

  .dashboard-inspect-meta-chip-wide {
    grid-column: auto;
  }

  .dashboard-inspect-filter-card-top {
    flex-direction: column;
  }
}

.kpi-card-v2.clickable,
.dash-card-v2.clickable {
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.kpi-card-v2.clickable:hover,
.kpi-card-v2.clickable:focus-within,
.dash-card-v2.clickable:hover,
.dash-card-v2.clickable:focus-within {
  /* No translateY — parent .dashboard-widget-content uses overflow:hidden and clips the top border */
  box-shadow: none;
  border-color: var(--green, #2D9C48);
}

.kpi-card-v2-icon {
  position: absolute;
  top: clamp(0.5rem, 4cqi, 1.125rem);
  right: clamp(0.5rem, 4cqi, var(--ds-content-pad));
  width: clamp(28px, 10cqi, 36px);
  height: clamp(28px, 10cqi, 36px);
  border-radius: 10px;
  background: var(--accent-muted);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-card-v2-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  flex-shrink: 0;
  min-width: 0;
}

.kpi-card-v2-head .dash-card-head-icon {
  position: static;
}

.kpi-card-v2-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(0.15rem, 1.8cqi, 0.4rem);
  padding: clamp(0.25rem, 2cqi, 0.5rem) clamp(0.35rem, 5cqi, 2.5rem) clamp(0.1rem, 1cqi, 0.25rem);
  min-height: 0;
  width: 100%;
}

.kpi-card-v2-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  font-size: clamp(0.55rem, 3.4cqi + 1.5cqh, 0.75rem);
  font-weight: 600;
  color: var(--ds-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.kpi-card-v2-label .pipeline-filter-summary {
  display: block;
  margin-top: 0.15rem;
  max-width: 100%;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.kpi-card-v2-filter-summary {
  display: block;
  font-size: clamp(0.5rem, 4.2cqi, 0.625rem);
  font-weight: 500;
  color: var(--gray-500, #6b7280);
  line-height: 1.25;
  margin: 0.15rem 0 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  letter-spacing: 0;
}

.dashboard-filter-star {
  color: var(--accent, #2D9C48);
  font-weight: 700;
  font-size: 0.95em;
  line-height: 1;
  text-decoration: none;
  cursor: help;
  border: none;
}

.ds-card-head h3 .dashboard-filter-star {
  margin-left: 0.2rem;
  vertical-align: super;
  font-size: 0.85em;
}

.kpi-card-v2-value {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 6.5cqi + 2.8cqh, 1.55rem);
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-trend {
  font-weight: 600;
  font-size: clamp(0.6rem, 3.2cqi + 1.4cqh, 0.78rem);
  line-height: 1.25;
  min-width: 0;
  flex: 1;
  text-align: left;
  overflow-wrap: anywhere;
}

.kpi-trend.positive { color: var(--brand-green); }
.kpi-trend.negative { color: var(--color-error); }
.kpi-trend.neutral { color: var(--gray-600); }

.kpi-card-v2-footer {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: clamp(0.25rem, 2cqi, 0.5rem);
  flex-shrink: 0;
  width: 100%;
  text-align: center;
}

.kpi-card-v2-link {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--green);
  font-family: var(--font-heading);
  font-size: clamp(0.625rem, 5cqi, 0.75rem);
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
  flex-shrink: 0;
  white-space: nowrap;
}

@container kpi-card (max-width: 170px) {
  .kpi-card-v2-icon:not(.dash-card-head-icon) {
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .kpi-card-v2-footer {
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
  }
}

.kpi-card-v2-link:hover {
  text-decoration: underline;
}

.ds-card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
}

.ds-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem var(--ds-content-pad) 0.75rem;
  gap: 0.75rem;
}

.pipeline-card-head {
  align-items: flex-start;
}

.pipeline-card-head-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.pipeline-filter-summary {
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ds-card-head h3 {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: -0.01em;
}

.ds-card-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--ds-text-muted);
}

.dashboard-period-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.dashboard-year-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0.25rem 0.35rem 0.25rem 0.85rem;
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: 999px;
  box-shadow: none;
  color: var(--brand-navy, var(--navy));
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.dashboard-year-filter > span {
  color: var(--gray-600);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.dashboard-year-filter select,
.ds-card-filter.dashboard-year-filter select,
.dashboard-period-select-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  margin: 0;
  border: none;
  outline: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23191847' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 12px;
  padding: 0.35rem 1.75rem 0.35rem 0.55rem;
  border-radius: 999px;
  color: var(--brand-navy, var(--navy));
  font: inherit;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  min-width: 4.25rem;
}
.dashboard-period-select-btn strong {
  font: inherit;
  font-weight: 700;
  color: inherit;
}
.dashboard-period-select-btn.is-open,
.dashboard-year-filter:has(.dashboard-period-select-btn.is-open) {
  background: var(--ds-surface, #fff);
  border-color: var(--accent, #2D9C48);
  box-shadow: 0 0 0 3px rgba(45, 156, 72, 0.16);
}
.dashboard-period-popover {
  width: 268px;
  z-index: 1600;
}
.dashboard-period-opt {
  font-family: inherit;
}
.dashboard-period-opt.is-on {
  border-color: var(--green, #2D9C48);
  background: rgba(45, 156, 72, 0.1);
  box-shadow: inset 3px 0 0 var(--green, #2D9C48);
}

.dashboard-year-filter:hover {
  background: var(--ds-surface-muted, var(--gray-100));
  border-color: var(--gray-300);
}

.dashboard-year-filter:focus-within {
  border-color: var(--accent, #2D9C48);
  box-shadow: 0 0 0 3px rgba(45, 156, 72, 0.16);
  background: var(--ds-surface, #fff);
}

.ds-card-filter select {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--ds-border);
  border-radius: 6px;
  background: var(--ds-surface);
  color: var(--text);
}

.pipeline-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.pipeline-column-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.pipeline-column-meta {
  font-size: 0.6875rem;
  color: var(--gray-600);
}

.pipeline-card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  box-shadow: var(--shadow-card);
}

.pipeline-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.pipeline-card-sub {
  font-size: 0.6875rem;
  color: var(--gray-600);
}

.pipeline-card-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.35rem;
}

.pipeline-badge {
  display: inline-block;
  font-size: 0.625rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-muted);
  color: var(--accent);
  margin-top: 0.35rem;
}

.pipeline-badge--venda {
  background: var(--tone-venda-bg);
  color: var(--tone-venda-fg);
}

.pipeline-badge--arrendamento {
  background: var(--tone-arrendamento-bg);
  color: var(--tone-arrendamento-fg);
}

.progress-card-body {
  padding: 0 1.125rem 1rem;
}

.progress-ring-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress-pct, 0%), var(--gray-200) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.progress-ring-svg-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring-svg-wrap .commission-ring-svg {
  position: absolute;
  inset: 0;
}

.progress-ring-svg-wrap .progress-ring-label {
  position: relative;
  z-index: 1;
}

.progress-ring::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--ds-surface);
}

.progress-ring-label {
  position: relative;
  z-index: 1;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
}

.challenge-list {
  padding: 0 1.125rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.challenge-item-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.challenge-bar-track {
  height: 6px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
}

.challenge-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.challenge-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

.leaderboard-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.leaderboard-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex: 0 0 auto;
  min-height: auto;
  width: 100%;
  padding: 0 0 0.45rem;
}

.leaderboard-kind {
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
}

.leaderboard-kind button {
  flex: 0 0 auto;
  white-space: nowrap;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.leaderboard-period {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
}

.leaderboard-period button {
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}

.leaderboard-period button.active {
  background: var(--navy);
  color: #fff;
}

.leaderboard-filters .leaderboard-period {
  height: 22px;
  box-sizing: border-box;
}

.leaderboard-filters .leaderboard-period button {
  padding-top: 0;
  padding-bottom: 0;
}

.leaderboard-month {
  flex: 0 0 auto;
  min-height: 0;
  gap: 0;
  margin-inline-start: auto;
}

.leaderboard-month.app-select-pill {
  min-height: 0;
}

.leaderboard-month .app-select-trigger {
  box-sizing: border-box;
  height: 22px;
  min-height: 22px;
  min-width: 3.1rem;
  padding: 0 1.15rem 0 0.5rem;
  font-size: 0.6875rem;
  line-height: 1;
  border-radius: 999px;
  background-position: right 0.35rem center;
  background-size: 10px;
}

.leaderboard-period-hint {
  margin: 0 0 0.5rem;
  font-size: 0.625rem;
  color: var(--gray-500);
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.75rem;
}

.leaderboard-row.is-me {
  font-weight: 700;
}

.leaderboard-row.is-self-rank {
  border-top: 1px dashed var(--gray-200);
  margin-top: 0.25rem;
}

.leaderboard-row:last-child { border-bottom: none; }

.leaderboard-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-sum {
  color: var(--gray-600);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.leaderboard-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.6875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.leaderboard-rank-tip {
  flex-shrink: 0;
}

.leaderboard-rank.is-top {
  width: auto;
  min-width: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--green, #2d9c48);
  color: #fff;
  gap: 1px;
}

.leaderboard-rank.rank-1 {
  background: linear-gradient(180deg, #f0c84a 0%, #d4a017 100%);
}

.leaderboard-rank.rank-2 {
  background: linear-gradient(180deg, #c5ced8 0%, #7b8798 100%);
}

.leaderboard-rank.rank-3 {
  background: linear-gradient(180deg, #d4a574 0%, #b0703a 100%);
}

.leaderboard-rank.is-stars.rank-1 {
  min-width: 34px;
}

.leaderboard-rank.is-stars.rank-2 {
  min-width: 28px;
}

.leaderboard-rank.is-top .ui-icon {
  width: 10px !important;
  height: 10px !important;
  font-size: 10px !important;
  color: #fff !important;
}

.leaderboard-rank.is-stars.rank-1 .ui-icon,
.leaderboard-rank.is-stars.rank-2 .ui-icon {
  width: 8px !important;
  height: 8px !important;
  font-size: 8px !important;
}

.activity-list {
  padding: 0 1.125rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.activity-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  font-size: 0.75rem;
}

.activity-row-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.activity-time {
  color: var(--gray-600);
  min-width: 4.6rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  padding-left: 5.1rem;
}

.activity-meta .activity-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-muted);
  color: var(--accent);
  flex-shrink: 0;
  white-space: nowrap;
}

.activity-badge--em-curso {
  background: var(--tone-em-curso-bg);
  color: var(--tone-em-curso-fg);
}

.activity-badge--concluido {
  background: var(--tone-concluido-bg);
  color: var(--tone-concluido-fg);
}

.activity-badge--perdido {
  background: var(--tone-perdido-bg);
  color: var(--tone-perdido-fg);
}

.activity-badge--venda {
  background: var(--tone-venda-bg);
  color: var(--tone-venda-fg);
}

.activity-badge--arrendamento {
  background: var(--tone-arrendamento-bg);
  color: var(--tone-arrendamento-fg);
}

.activity-badge--operacao {
  background: rgba(31, 44, 92, 0.08);
  color: #1F2C5C;
}

.activity-badge--consultor {
  background: var(--gray-100, #f2f4f8);
  color: var(--brand-navy, #1F2C5C);
}

.activity-title {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-bars-card {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  container-type: size;
  container-name: dash-card;
}
.dash-bars-card .ds-card-head { align-items: center; flex-shrink: 0; }

.dash-count-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  align-content: stretch;
  gap: clamp(0.28rem, 1.6cqh, 0.65rem);
  padding: 0 0 clamp(0.3rem, 1.4cqh, 0.85rem);
}

.dash-count-tile {
  container-type: size;
  container-name: count-tile;
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.06rem, 4cqh, 0.2rem);
  min-width: 0;
  min-height: 0;
  padding: clamp(0.22rem, 8cqh, 0.65rem) clamp(0.4rem, 4cqi, 0.8rem);
  background: var(--ds-surface-muted, var(--gray-100));
  border-radius: 10px;
  border-left: 3px solid #2D9C48;
  overflow: hidden;
}

.dash-count-label {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  max-width: 100%;
  font-size: clamp(0.5rem, 22cqh, 0.7rem);
  font-weight: 600;
  color: var(--ds-text-muted, var(--gray-600));
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-count-value {
  position: relative;
  z-index: 0;
  flex: 0 1 auto;
  min-height: 0;
  max-width: 100%;
  font-family: var(--font-heading);
  font-size: clamp(0.78rem, 38cqh, 1.5rem);
  font-weight: 700;
  color: #1F2C5C;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}

@container dash-card (min-width: 22rem) {
  .dash-count-grid {
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  }
}

@container dash-card (max-height: 13.5rem) {
  .dash-count-tile {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
  }
  .dash-count-label {
    flex: 1 1 auto;
    font-size: clamp(0.5rem, 3.2cqi, 0.68rem);
  }
  .dash-count-value {
    flex: 0 0 auto;
    font-size: clamp(0.85rem, 6cqi, 1.25rem);
  }
}

.prob-multi { position: relative; flex: 0 0 auto; }
.prob-multi-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.25rem 0.85rem;
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: 999px;
  background: var(--ds-surface, #fff);
  color: var(--brand-navy, var(--navy));
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.prob-multi-btn span { color: var(--gray-600); font-weight: 500; }
.prob-multi-btn strong { font-weight: 700; }
.prob-multi-btn.is-open,
.prob-multi-btn:hover {
  background: var(--ds-surface-muted, var(--gray-100));
  border-color: #1F2C5C;
}
.prob-multi-menu {
  position: fixed;
  z-index: 200;
  width: 196px;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid rgba(31, 44, 92, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(31, 44, 92, 0.16);
}
.prob-multi-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  color: #1F2C5C;
  font-size: 0.8125rem;
  font-weight: 650;
  cursor: pointer;
}
.prob-multi-option:hover,
.prob-multi-option.is-on { background: rgba(31, 44, 92, 0.06); }
.prob-multi-option input { accent-color: #2D9C48; }
.dash-bars {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.2rem, 2.4cqh, 0.85rem);
  padding: 0 0 clamp(0.1rem, 1cqh, 0.5rem);
}
.dash-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label label"
    "track value";
  gap: clamp(0.1rem, 1.1cqh, 0.28rem) clamp(0.25rem, 1.2cqi, 0.45rem);
  align-items: center;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
}
.dash-bar-row .ui-tooltip-host {
  display: block;
  min-width: 0;
  width: 100%;
}
.dash-bar-row > .dash-bar-track,
.dash-bar-row > .ui-tooltip-host,
.dash-bar-row > .dash-bar-pair {
  grid-area: track;
  min-width: 0;
}
.dash-bars > .dash-bar-legend,
.dash-bars > .empty-hint {
  flex: 0 0 auto;
  grid-column: 1 / -1;
}
.dash-bar-label {
  grid-area: label;
  min-width: 0;
  max-width: 100%;
  font-size: clamp(0.55rem, 0.42rem + 1.4cqi + 0.5cqh, 0.75rem);
  font-weight: 600;
  color: var(--brand-navy, var(--navy));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-bar-track {
  height: clamp(6px, 2.2cqh, 12px);
  min-width: 1.25rem;
  background: rgba(31, 44, 92, 0.08);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}
.dash-bar-pair { display: flex; flex-direction: column; gap: 4px; }
.dash-bar-fill { height: 100%; background: #1F2C5C; border-radius: 999px; min-width: 2px; }
.dash-bar-fill.is-venda, .dash-bar-fill.is-pipe { background: #1F2C5C; }
.dash-bar-fill.is-arrend, .dash-bar-fill.is-won { background: #2D9C48; }
.dash-bar-fill.is-fat { background: #2D9C48; }
.dash-bar-fill.is-fat-src { background: #1F2C5C; }
.dash-bar-fill.is-ref-src { background: #2D9C48; }
.dash-bar-fill.is-part-src { background: #3D6B8C; }
.dash-bar-value {
  grid-area: value;
  font-size: clamp(0.55rem, 0.42rem + 1.4cqi + 0.5cqh, 0.75rem);
  font-weight: 600;
  color: var(--brand-navy, var(--navy));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  justify-self: end;
  align-self: center;
}
.dash-bar-legend { display: flex; gap: 0.85rem; font-size: 0.6875rem; color: var(--gray-600); }
.dash-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.3rem; vertical-align: middle; }
.dash-swatch.is-venda, .dash-swatch.is-pipe { background: #1F2C5C; }
.dash-swatch.is-arrend, .dash-swatch.is-won { background: #2D9C48; }
.dash-swatch.is-fat-src { background: #1F2C5C; }
.dash-swatch.is-ref-src { background: #2D9C48; }
.dash-swatch.is-part-src { background: #3D6B8C; }

.dash-card-head-icon {
  position: static;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.ds-card-head h3 .dash-card-head-icon,
.chart-card-title .dash-card-head-icon {
  margin-right: 0.15rem;
}
.chart-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dash-faturacao-card {
  container-type: size;
  container-name: dash-card kpi-card;
}
.dash-faturacao-card .chart-card-header {
  margin-bottom: 0.2rem;
  padding: 0.75rem var(--ds-content-pad, 1.125rem) 0;
  gap: 0.4rem;
}
.dash-faturacao-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(0.2rem, 1.6cqh, 0.55rem);
  padding: 0 clamp(0.55rem, 2.4cqi, 1.125rem) clamp(0.35rem, 1.4cqh, 0.7rem);
}
.dash-mini-pie-tip {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.dash-faturacao-hero {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex-shrink: 0;
}
.dash-faturacao-card .dash-stat-hero {
  font-size: clamp(0.85rem, 4.6cqi + 1.1cqh, 1.35rem) !important;
}
.dash-faturacao-pies {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.15rem, 1.2cqi, 0.45rem);
  align-items: center;
  align-content: center;
  justify-items: center;
}
.dash-faturacao-pie {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-width: 0;
  width: 100%;
}
.dash-faturacao-pie > .ui-tooltip-host {
  display: flex;
  justify-content: center;
  width: 100%;
}
.dash-mini-pie-svg {
  width: min(100%, 5.6rem, 38cqh);
  height: auto;
  aspect-ratio: 1;
  display: block;
  margin-inline: auto;
}
.dash-mini-pie-center {
  font-size: 13px;
  font-weight: 700;
  fill: #1F2C5C;
  pointer-events: none;
}
.dash-faturacao-pie-cap {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.dash-faturacao-pie-name {
  font-size: clamp(0.5rem, 1.6cqi + 0.3cqh, 0.625rem);
  font-weight: 600;
  color: var(--ds-text-muted, var(--gray-600));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.dash-faturacao-pie-amt {
  font-family: var(--font-heading);
  font-size: clamp(0.58rem, 2.1cqi + 0.4cqh, 0.75rem);
  font-weight: 700;
  color: #1F2C5C;
  font-variant-numeric: tabular-nums;
}
.dash-faturacao-legend-item {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
}
@container dash-card (max-width: 11.5rem) {
  .dash-faturacao-pies {
    grid-template-columns: 1fr;
  }
}
@container dash-card (max-width: 16.5rem) or (max-height: 13.5rem) {
  .dash-faturacao-pie-name { display: none; }
}
@container dash-card (max-width: 12rem) or (max-height: 11rem) {
  .dash-faturacao-legend { display: none; }
}
.dash-faturacao-card .dash-bars {
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
  gap: 0.7rem;
}
.dash-faturacao-card .dash-bar-row {
  grid-template-columns: minmax(0, 4.4rem) minmax(0, 1fr) auto;
  grid-template-areas: "label track value";
}

@container dash-card (min-width: 16rem) and (min-height: 13.5rem) {
  .dash-bar-row,
  .dash-faturacao-card .dash-bar-row {
    grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto;
    grid-template-areas: "label track value";
    gap: clamp(0.2rem, 1.4cqi, 0.5rem);
  }
  .dash-faturacao-card .dash-bar-row {
    grid-template-columns: minmax(0, 4.4rem) minmax(0, 1fr) auto;
  }
}

@container dash-card (max-height: 13.5rem) {
  .dash-bars {
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    justify-content: stretch;
    gap: clamp(0.18rem, 2cqh, 0.55rem) clamp(0.35rem, 2cqi, 0.85rem);
  }
  .dash-bar-row,
  .dash-faturacao-card .dash-bar-row {
    flex: unset;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label label"
      "track value";
    gap: 0.12rem 0.4rem;
  }
}

@container dash-card (min-width: 22rem) and (max-height: 13.5rem) {
  .dash-bars {
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  }
}

.dash-bars-card.is-title-compact .dash-bar-row,
.dash-bars-card.is-title-compact.dash-faturacao-card .dash-bar-row {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label label"
    "track value";
  gap: 0.1rem 0.35rem;
}
.dash-faturacao-legend {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: clamp(0.28rem, 1.4cqi, 0.7rem);
  padding-top: 0.2rem;
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
}
.dash-faturacao-legend .ui-tooltip-host {
  display: inline-flex;
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
}
.cache-status-card { margin-bottom: 1rem; }
.cache-status-body { padding: 0 1.125rem 1rem; }
.cache-status-summary { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.75rem; }
.cache-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.06);
  color: #1F2C5C;
  font-size: 0.75rem;
  font-weight: 700;
}
.cache-status-pill.is-ok { background: rgba(45, 156, 72, 0.14); color: #1d7a34; }
.cache-status-pill.is-off { background: rgba(180, 60, 60, 0.1); color: #9b2c2c; }
.cache-status-pill.is-busy { background: rgba(45, 156, 72, 0.2); }
.cache-status-table { display: flex; flex-direction: column; gap: 0.15rem; }
.cache-status-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.8fr 1fr 1.2fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(31, 44, 92, 0.08);
  font-size: 0.78rem;
  color: #1F2C5C;
}
.cache-status-row.is-head { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: #5c6578; }

.mix-vbar-card { display: flex; flex-direction: column; }
.mix-vbar-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(0.55rem, 2.2cqi, 0.85rem) clamp(0.4rem, 1.6cqh, 0.7rem);
}
.mix-compare {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.4rem, 2.4cqh, 0.7rem);
  min-height: 0;
}
.mix-compare-head,
.mix-compare-row {
  display: grid;
  grid-template-columns: minmax(3.4rem, 0.9fr) minmax(0, 1.15fr) minmax(0, 1.15fr);
  gap: 0.2rem 0.45rem;
  align-items: center;
  min-width: 0;
}
.mix-compare-head {
  font-size: clamp(0.58rem, 1.5cqi + 0.3cqh, 0.7rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ds-text-muted, var(--gray-600));
}
.mix-compare-head span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}
.mix-compare-head .is-venda,
.mix-compare-row .is-venda { color: #1F2C5C; }
.mix-compare-head .is-arrend,
.mix-compare-row .is-arrend { color: #1d7a34; }
.mix-compare-tip {
  display: block;
  width: 100%;
  min-width: 0;
}
.mix-compare-row {
  cursor: pointer;
}
.mix-compare-row .mix-vbar-label {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mix-compare-row strong {
  font-size: clamp(0.58rem, 1.6cqi + 0.35cqh, 0.88rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: nowrap;
  min-width: max-content;
  overflow: visible;
  text-overflow: clip;
}
.mix-compare-row .mix-tile-track {
  grid-column: 2 / -1;
}
.mix-tile-track {
  display: flex;
  width: 100%;
  height: clamp(6px, 2.2cqh, 9px);
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.08);
  overflow: hidden;
}
.mix-tile-track .mix-row-fill { height: 100%; flex: 0 0 auto; }
.mix-row-fill { display: block; height: 100%; border-radius: 999px; }
.mix-row-fill.is-venda { background: #1F2C5C; }
.mix-row-fill.is-arrend { background: #2D9C48; }
@container dash-card (max-height: 11.5rem) or (max-width: 14rem) {
  .mix-compare-row .mix-tile-track { display: none; }
}
@container dash-card (max-width: 12rem) {
  .mix-compare-head,
  .mix-compare-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.12rem 0.28rem;
  }
  .mix-vbar-year {
    min-height: 1.2rem;
    padding: 0 0.4rem;
    font-size: 0.62rem;
  }
}
/* Wide cards: keep Venda / Arrend. amounts fully visible (do not ellipsize). */
@container dash-card (min-width: 22rem) {
  .mix-compare {
    gap: clamp(0.35rem, 1.4cqh, 0.65rem);
  }
  .mix-compare-head,
  .mix-compare-row {
    grid-template-columns: minmax(3.6rem, 1fr) max-content max-content;
    column-gap: clamp(0.4rem, 1.4cqi, 0.85rem);
  }
  .mix-compare-head {
    font-size: clamp(0.62rem, 0.4rem + 0.55cqi + 0.2cqh, 0.78rem);
  }
  .mix-compare-head .is-venda,
  .mix-compare-head .is-arrend,
  .mix-compare-row strong {
    justify-self: end;
    text-align: right;
  }
  .mix-compare-row .mix-vbar-label {
    text-align: left;
  }
  .mix-compare-row strong {
    font-size: clamp(0.7rem, 0.48rem + 0.55cqi + 0.25cqh, 0.92rem);
  }
  .mix-vbar-label,
  .dashboard-widget-card .mix-vbar-label {
    font-size: clamp(0.68rem, 0.46rem + 0.55cqi + 0.2cqh, 0.88rem);
  }
  .mix-vbar-card .kpi-card-v2-label {
    font-size: clamp(0.68rem, 0.42rem + 0.55cqi, 0.88rem);
  }
  .mix-tile-track {
    height: clamp(6px, 2cqh, 10px);
  }
}
.mix-vbar-group { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.mix-vbar-cols { flex: 1; width: 100%; min-height: 0; display: flex; gap: 0.35rem; }
.mix-vbar-cols .ui-tooltip-host { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.mix-vbar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.mix-vbar-track { flex: 1; width: 100%; max-width: 1.15rem; min-height: 0; display: flex; align-items: flex-end; background: rgba(31, 44, 92, 0.08); border-radius: 999px; overflow: hidden; }
.mix-vbar-fill { width: 100%; border-radius: 999px; }
.mix-vbar-fill.is-venda { background: #1F2C5C; }
.mix-vbar-fill.is-arrend { background: #2D9C48; }
.dash-card-v2-head .kpi-card-v2-head:has(.dash-card-period-label) {
  align-items: flex-start;
}
.kpi-card-v2-label:has(.dash-card-period-label) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  white-space: normal;
  overflow: hidden;
}
.kpi-card-v2-label .dash-card-title-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-card-v2.is-title-compact .dash-card-title-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}
.kpi-card-v2-label .dash-card-period-label {
  display: block;
  margin: 0;
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ds-text-muted, var(--gray-600));
  text-transform: none;
  letter-spacing: 0;
}
.mix-vbar-year {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.06);
  color: #1F2C5C;
  font-size: 0.75rem;
  font-weight: 700;
}
.mix-vbar-label { font-size: 0.75rem; font-weight: 700; color: #1F2C5C; text-align: left; }
.mix-vbar-meta {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.15;
  color: #1F2C5C;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mix-vbar-legend { justify-content: center; padding-top: 0.35rem; flex-shrink: 0; }

.dash-prob-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.dash-prob-chip {
  border: 1px solid var(--ds-border, var(--gray-200));
  background: var(--gray-100, #f3f4f6);
  color: var(--brand-navy, var(--navy));
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  min-height: 1.75rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.dash-prob-chip.active { background: #1F2C5C; border-color: #1F2C5C; color: #fff; }
.dash-fat-pies { display: flex; flex-direction: column; gap: 0.85rem; padding-bottom: 0.25rem; }
.dash-share-list { display: flex; flex-direction: column; gap: 0.45rem; }
.dash-share-title { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--gray-600); padding: 0 var(--ds-content-pad, 1.125rem); }

.inserir-menu { position: relative; z-index: 40; }
.inserir-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(31, 44, 92, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(31, 44, 92, 0.12);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
}
.inserir-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.inserir-item:hover { background: rgba(31, 44, 92, 0.06); }
.inserir-item.is-pending { opacity: 0.55; }

.cal-page {
  display: grid;
  grid-template-columns: auto 1fr;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border, #e2e6ee);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}
.cal-aside-wrap,
.cal-aside-rail,
.cal-aside {
  border-bottom-left-radius: inherit;
}
.cal-main {
  border-bottom-right-radius: inherit;
}
.cal-aside-wrap {
  position: relative;
  width: 260px;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  transition: width 0.22s ease;
}
.cal-aside-wrap.is-collapsed {
  width: 3.55rem;
  overflow: hidden;
}
.cal-aside {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: 260px;
  height: 100%;
  padding: 1.1rem 1rem 1.25rem;
  border-right: 1px solid var(--ds-border, #e2e6ee);
  background: #fff;
  overflow: auto;
  box-sizing: border-box;
}
.cal-aside-wrap.is-collapsed .cal-aside {
  display: none;
}
.cal-aside-rail {
  display: none;
}
.cal-aside-wrap.is-collapsed .cal-aside-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
  width: 3.55rem;
  height: 100%;
  padding: 0.7rem 0.32rem 0.9rem;
  border-right: 1px solid var(--ds-border, #e2e6ee);
  background: #fff;
  box-sizing: border-box;
  overflow: auto;
}
.cal-aside-rail .ui-tooltip-host {
  width: auto;
  display: flex;
  justify-content: center;
}
.cal-aside-rail .cal-aside-toggle {
  box-shadow: none;
}
.cal-rail-day {
  position: relative;
  width: 2.15rem;
  height: 2.15rem;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.cal-rail-count {
  position: absolute;
  top: -0.2rem;
  right: -0.22rem;
  min-width: 0.95rem;
  height: 0.95rem;
  padding: 0 0.18rem;
  border-radius: 999px;
  background: var(--green, #2D9C48);
  color: #fff;
  font-size: 0.56rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.cal-rail-sep {
  width: 1.35rem;
  height: 1px;
  background: var(--ds-border, #e2e6ee);
  margin: 0.12rem 0;
  flex-shrink: 0;
}
.cal-rail-ico {
  width: 2.05rem;
  height: 2.05rem;
  border: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--navy);
  background: var(--ds-surface-muted, #f2f4f8);
}
.cal-rail-ico.is-pessoal { color: var(--tone-concluido-fg); background: var(--tone-concluido-bg); }
.cal-rail-ico.is-tarefas { color: var(--tone-em-curso-fg); background: var(--tone-em-curso-bg); }
.cal-rail-ico.is-aniversarios { color: var(--green); background: var(--green-muted); }
.cal-rail-ico.is-fotografia { color: var(--navy); background: var(--green-muted); }
.cal-rail-ico:not(.is-on),
.cal-rail-cat:not(.is-on) { opacity: 0.34; }
.cal-rail-cat {
  width: 2.05rem;
  height: 1.45rem;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.cal-rail-livre {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 5px;
  background: rgba(45, 156, 72, 0.22);
  box-shadow: inset 0 0 0 1px rgba(45, 156, 72, 0.4);
}
.cal-aside-rail .ui-tooltip-host:has(.cal-rail-swatch) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 1.45rem;
}
.cal-rail-swatch {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  border-radius: 5px;
}
.cal-aside-toggle-tip.ui-tooltip-host {
  position: absolute;
  top: 1.2rem;
  right: 0;
  width: auto;
  transform: translateX(50%);
  z-index: 6;
}
.cal-aside-wrap.is-collapsed .cal-aside-toggle-tip.ui-tooltip-host {
  display: none;
}
.cal-aside-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--white, #fff);
  color: var(--accent, #2D9C48);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(25, 24, 71, 0.12);
  padding: 0;
  line-height: 0;
}
.cal-aside-toggle:hover {
  background: var(--gray-100);
  box-shadow: 0 4px 12px rgba(25, 24, 71, 0.16);
}
.cal-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}
.cal-mini-head strong {
  font-size: 0.8rem;
  color: var(--navy);
  text-transform: capitalize;
}
.cal-mini-nav { display: flex; gap: 0.1rem; }
.cal-mini-weekdays,
.cal-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}
.cal-mini-weekdays span {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ds-text-muted, #5b6b7c);
  text-transform: uppercase;
}
.cal-mini-day {
  border: 0;
  background: transparent;
  border-radius: 999px;
  width: 100%;
  aspect-ratio: 1;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.cal-mini-day.is-out { color: var(--gray-400); }
.cal-mini-day.is-today { box-shadow: inset 0 0 0 1px var(--green); }
.cal-mini-day.is-selected,
.cal-mini-day:hover {
  background: var(--navy);
  color: #fff;
}
.cal-next {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  background: var(--ds-surface-muted, #f2f4f8);
  border: 1px solid var(--ds-border, #e2e6ee);
}
.cal-next-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--green-muted);
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cal-next strong {
  display: block;
  color: var(--navy);
  font-size: 0.8rem;
}
.cal-next span {
  display: block;
  margin-top: 0.15rem;
  color: var(--ds-text-muted, #5b6b7c);
  font-size: 0.72rem;
}
.cal-aside-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cal-aside-block .avaliacao-check { width: 100%; }
.cal-cat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: transparent;
  padding: 0.2rem 0;
  color: var(--navy);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
}
.cal-cat-row:not(.is-on) { opacity: 0.4; }
.cal-legend-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--navy);
  line-height: 1.3;
}
.cal-legend-row small {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ds-text-muted, #5b6b7c);
}
.cal-legend-swatch {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.cal-legend-swatch.is-livre {
  background: rgba(45, 156, 72, 0.22);
  box-shadow: inset 0 0 0 1px rgba(45, 156, 72, 0.4);
}
.cal-legend-swatch.is-bloqueado {
  background: rgba(31, 44, 92, 0.10);
  box-shadow: inset 0 0 0 1px rgba(31, 44, 92, 0.22);
}
.cal-legend-swatch.is-pendente {
  background: var(--tone-arrendamento-bg);
  box-shadow: inset 0 0 0 1px rgba(154, 52, 18, 0.35);
}
.cal-legend-swatch.is-aprovado {
  background: var(--tone-aprovado-bg);
  box-shadow: inset 0 0 0 1px rgba(109, 40, 217, 0.4);
}
.cal-cancel-reason textarea {
  min-height: 4.5rem;
  resize: vertical;
  line-height: 1.35;
}
.cal-cancel-reason small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ds-text-muted, #5b6b7c);
  text-transform: none;
  letter-spacing: 0;
}
.cal-cat-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
}
.cal-cat-dot.is-pessoal { background: var(--tone-concluido-fg); }
.cal-cat-dot.is-trabalho { background: var(--tone-em-curso-fg); }
.cal-cat-dot.is-saude { background: var(--tone-arrendamento-fg); }
.cal-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  background: #fff;
  overflow: hidden;
}
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding: 0.85rem 1rem 0.55rem;
}
.cal-toolbar-title {
  flex: 1;
  min-width: 8rem;
  font-size: 1.1rem;
  color: var(--navy);
  text-transform: capitalize;
}
.cal-views { display: flex; gap: 0.25rem; }
.cal-toolbar-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cal-toolbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.cal-load-error { padding: 0 1rem 0.4rem; }
.cal-event-owner {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  color: var(--ds-text-muted, #5b6b7c);
}
.cal-export {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 0.2rem;
}
.cal-choice-popover { width: 360px; }
.cal-choice-popover .chart-filter-popover-body {
  padding: 0.7rem 0.85rem 0.85rem;
  gap: 0.5rem;
}
.cal-choice-lead {
  margin: 0;
  padding: 0 0.1rem 0.15rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ds-text-muted, #5b6b7c);
}
.cal-choice-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--ds-border, #e2e6ee);
  border-radius: 12px;
  background: var(--ds-surface, #fff);
  color: #1F2C5C;
  text-align: left;
  cursor: pointer;
}
.cal-choice-option:hover {
  border-color: #2D9C48;
  box-shadow: 0 4px 14px rgba(31, 44, 92, 0.08);
}
.cal-choice-option-wrap {
  width: 100%;
}
.cal-choice-option:disabled,
.cal-choice-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.cal-choice-option:disabled:hover,
.cal-choice-option.is-disabled:hover {
  border-color: var(--ds-border, #e2e6ee);
  box-shadow: none;
}
.cal-choice-option-ico {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 156, 72, 0.12);
  color: #1F2C5C;
}
.cal-choice-option strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1F2C5C;
}
.cal-choice-option small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: #5c6784;
}
.cal-event.is-livre { background: var(--green-muted); color: var(--green); }
.cal-event.is-bloqueado { background: #eef0f4; color: #5b6b7c; }
.cal-event.is-pendente,
.cal-event.is-reagendar { background: var(--tone-arrendamento-bg); color: var(--tone-arrendamento-fg); }
.cal-event.is-aprovado {
  background: var(--tone-aprovado-bg);
  color: var(--tone-aprovado-fg);
}
.cal-event.is-ocupado { background: #eef0f4; color: var(--navy); }
.cal-grid {
  display: grid;
  grid-template-columns: 3.25rem repeat(var(--cal-days, 7), minmax(0, 1fr));
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-top: 1px solid var(--ds-border, #e2e6ee);
}
.cal-week-grid {
  display: flex;
  flex-direction: column;
  --cal-hour-h: 3.25rem;
}
.cal-week-head {
  display: grid;
  grid-template-columns: 3.25rem repeat(var(--cal-days, 7), minmax(0, 1fr));
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f7f8;
  flex: 0 0 auto;
}
.cal-week-body {
  display: grid;
  grid-template-columns: 3.25rem repeat(var(--cal-days, 7), minmax(0, 1fr));
  min-width: 0;
  min-height: calc(var(--cal-hours, 12) * var(--cal-hour-h, 3.25rem));
  flex: 1 1 auto;
  align-items: stretch;
  background: #fff;
}
.cal-week-times {
  display: grid;
  grid-template-rows: repeat(var(--cal-hours, 12), minmax(var(--cal-hour-h, 3.25rem), 1fr));
  min-height: 0;
  height: 100%;
}
.cal-week-day {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: repeat(var(--cal-hours, 12), minmax(var(--cal-hour-h, 3.25rem), 1fr));
  height: 100%;
}
.cal-week-event {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 1;
  min-width: 0;
  max-width: calc(100% - 6px);
  overflow: hidden;
  box-sizing: border-box;
}
.cal-week-event > .ui-tooltip-host,
.cal-week-event .cal-event {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.cal-week-event .cal-event {
  padding: 0.12rem 0.3rem 0.12rem 0.26rem;
  gap: 0.05rem;
  border-radius: 7px;
  box-shadow: none;
}
.cal-week-event .cal-event-head {
  min-height: 0;
  flex-shrink: 1;
}
.cal-week-event .cal-event-ico {
  width: 0.85rem;
  height: 0.85rem;
}
.cal-week-event .cal-event-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
}
.cal-week-event.is-short .cal-event {
  flex-direction: row;
  align-items: center;
  padding: 0.08rem 0.32rem 0.08rem 0.22rem;
  border-radius: 7px;
}
.cal-week-event .cal-event-time {
  padding-left: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.cal-cell {
  border-top: 1px solid rgba(31, 44, 92, 0.08);
  border-left: 1px solid rgba(31, 44, 92, 0.06);
  min-width: 0;
  min-height: var(--cal-hour-h, 3.25rem);
  padding: 3px;
  font-size: 0.7rem;
  box-sizing: border-box;
}
.cal-head,
.cal-time {
  background: #f7f7f8;
  font-weight: 600;
  padding: 0.4rem 0.3rem;
  color: var(--navy);
}
.cal-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-height: 3.4rem;
}
.cal-head-wd {
  font-size: 0.68rem;
  text-transform: capitalize;
  color: var(--ds-text-muted, #5b6b7c);
}
.cal-head-num {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
}
.cal-head.is-selected .cal-head-num,
.cal-head.is-today .cal-head-num {
  background: var(--navy);
  color: #fff;
}
.cal-week-times .cal-time,
.cal-week-day .cal-slot {
  height: auto;
  min-height: 0;
  max-height: none;
}
.cal-week-times .cal-time:last-child,
.cal-week-day .cal-slot:last-child {
  border-bottom: 1px solid rgba(31, 44, 92, 0.08);
}
.cal-slot {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.cal-week-day .cal-slot.is-livre {
  background: rgba(45, 156, 72, 0.12);
}
.cal-week-day .cal-slot.is-livre:hover {
  background: rgba(45, 156, 72, 0.2);
}
.cal-week-day .cal-slot.is-livre-partial {
  background-color: transparent;
  background-repeat: no-repeat;
}
.cal-week-day .cal-slot.is-livre-partial:hover {
  filter: brightness(0.97);
}
.cal-week-day .cal-slot.is-bloqueado {
  background: rgba(31, 44, 92, 0.08);
}
.cal-week-day .cal-slot.is-bloqueado:hover {
  background: rgba(31, 44, 92, 0.14);
}
.cal-slot-add {
  display: none;
  position: absolute;
  inset: 6px;
  border: 1px dashed var(--ds-border, #e2e6ee);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
}
.cal-slot:hover .cal-slot-add { display: flex; }
.cal-event {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  border: 0;
  border-radius: 9px;
  padding: 0.28rem 0.38rem 0.28rem 0.34rem;
  font-size: 0.68rem;
  cursor: pointer;
  margin-bottom: 3px;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(31, 44, 92, 0.06);
  border-left: 3px solid currentColor;
  box-sizing: border-box;
  overflow: hidden;
}
.cal-event-head {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
}
.cal-event-ico {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cal-event-title {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cal-event-time {
  opacity: 0.85;
  padding-left: 1.47rem;
}
.cal-event.is-compact .cal-event-title {
  white-space: nowrap;
  display: block;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
}
.cal-event.is-pessoal { background: var(--tone-concluido-bg); color: var(--tone-concluido-fg); }
.cal-event.is-trabalho { background: var(--tone-em-curso-bg); color: var(--tone-em-curso-fg); }
.cal-event.is-saude { background: var(--tone-arrendamento-bg); color: var(--tone-arrendamento-fg); }
.cal-event.is-compact {
  flex-direction: row;
  align-items: center;
  padding: 0.14rem 0.4rem 0.14rem 0.28rem;
  border-radius: 999px;
}
.cal-event.is-compact .cal-event-time { display: none; }
.cal-event.is-compact .cal-event-ico {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
}
.cal-source-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cal-source-ico {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--navy);
  background: var(--ds-surface-muted, #f2f4f8);
}
.cal-source-ico.is-pessoal { color: var(--tone-concluido-fg); background: var(--tone-concluido-bg); }
.cal-source-ico.is-tarefas { color: var(--tone-em-curso-fg); background: var(--tone-em-curso-bg); }
.cal-source-ico.is-aniversarios { color: var(--green); background: var(--green-muted); }
.cal-source-ico.is-fotografia { color: var(--navy); background: var(--green-muted); }
.cal-month {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-top: 1px solid var(--ds-border, #e2e6ee);
}
.cal-month-heads {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  position: sticky;
  top: 0;
  z-index: 3;
}
.cal-month-head {
  padding: 0.45rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ds-text-muted, #5b6b7c);
  background: #f7f7f8;
  border-bottom: 1px solid var(--ds-border, #e2e6ee);
  text-align: center;
}
.cal-month-week {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  flex: 1;
  min-height: 6.2rem;
  --span-lane-h: 1.22rem;
}
.cal-month-cell {
  min-height: 6.2rem;
  padding: 0.35rem;
  border-top: 1px solid rgba(31, 44, 92, 0.08);
  border-left: 1px solid rgba(31, 44, 92, 0.06);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}
.cal-month-cell.is-out { background: #fafbfc; }
.cal-month-cell.is-selected {
  background: rgba(31, 44, 92, 0.10);
}
.cal-month-cell.is-livre:not(.is-today) {
  background: rgba(45, 156, 72, 0.12);
}
.cal-month-cell.is-livre.is-out:not(.is-today) {
  background: rgba(45, 156, 72, 0.08);
}
.cal-month-cell.is-livre.is-selected:not(.is-today) {
  background: rgba(45, 156, 72, 0.18);
}
.cal-month-cell.is-bloqueado:not(.is-today) {
  background: rgba(31, 44, 92, 0.08);
}
.cal-month-cell.is-bloqueado.is-out:not(.is-today) {
  background: rgba(31, 44, 92, 0.05);
}
.cal-month-cell.is-bloqueado.is-selected:not(.is-today) {
  background: rgba(31, 44, 92, 0.14);
}
.cal-month-cell.is-today {
  background: rgba(31, 44, 92, 0.12);
}
.cal-month-cell.is-today.is-selected {
  background: rgba(31, 44, 92, 0.18);
}
.cal-month-cell.is-today.is-out {
  background: rgba(31, 44, 92, 0.08);
}
.cal-month-cell-head {
  display: flex;
  align-items: center;
  gap: 0.28rem;
}
.cal-month-cell-head .ui-tooltip-host {
  display: inline-flex;
  align-items: center;
}
.cal-month-livre-dot {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(45, 156, 72, 0.22);
  flex-shrink: 0;
}
.cal-month-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.45rem;
  width: 1.45rem;
  height: 1.45rem;
  min-width: 1.45rem;
  min-height: 1.45rem;
  max-width: 1.45rem;
  aspect-ratio: 1;
  box-sizing: border-box;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
}
.cal-month-num.is-today {
  background: var(--navy);
  color: #fff;
}
.cal-month-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: calc(0.15rem + var(--span-lanes, 0) * var(--span-lane-h, 1.22rem));
  min-width: 0;
}
.cal-month-events .cal-event {
  padding: 0.08rem 0.32rem 0.08rem 0.22rem;
  font-size: 0.62rem;
  min-height: 1.15rem;
  margin-bottom: 0;
  border-radius: 6px;
}
.cal-month-events .cal-event-ico {
  width: 0.8rem;
  height: 0.8rem;
}
.cal-month-week-spans {
  position: absolute;
  left: 0;
  right: 0;
  top: 1.85rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: var(--span-lane-h, 1.22rem);
  row-gap: 0;
  pointer-events: none;
  z-index: 2;
}
.cal-month-span {
  min-width: 0;
  padding: 0 3px 2px;
  pointer-events: auto;
}
.cal-month-span > .ui-tooltip-host,
.cal-month-span .cal-event {
  width: 100%;
  max-width: 100%;
  height: 1.15rem;
  min-height: 1.15rem;
  margin: 0;
}
.cal-event.is-span:not(.is-span-bar) {
  border-radius: 0;
  margin-left: -0.35rem;
  margin-right: -0.35rem;
  width: auto;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  border-left-width: 0;
}
.cal-event.is-span-start {
  border-radius: 6px 0 0 6px;
  margin-left: 0;
  border-left-width: 3px;
}
.cal-event.is-span-end {
  border-radius: 0 6px 6px 0;
  margin-right: 0;
}
.cal-event.is-span-start.is-span-end {
  border-radius: 6px;
  margin-left: 0;
  margin-right: 0;
}
.cal-event.is-span-bar {
  border-radius: 6px;
  margin: 0;
  width: 100%;
  max-width: 100%;
  flex-direction: row;
  align-items: center;
  padding: 0.08rem 0.4rem 0.08rem 0.28rem;
  border-left-width: 3px;
  box-shadow: none;
}
.cal-event.is-span-bar .cal-event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.cal-month-span.is-clip-start .cal-event.is-span-bar {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -3px;
  padding-left: 0.5rem;
}
.cal-month-span.is-clip-end .cal-event.is-span-bar {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: -3px;
}
.cal-month-more {
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.05rem 0.3rem;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}
.cal-month-more:hover {
  background: var(--ds-surface-muted, #f2f4f8);
}
.cal-span-hint {
  margin: -0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--ds-text-muted, #5b6b7c);
}
.cal-slot-span {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.cal-slot-span .tab {
  flex: 1;
  text-align: center;
  justify-content: center;
}
.cal-week-manage {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cal-week-manage-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.45rem;
  border: 1px solid var(--ds-border, #e2e6ee);
  border-radius: 10px;
  background: #fff;
}
.cal-week-manage-item.is-editing {
  border-color: rgba(45, 156, 72, 0.45);
  box-shadow: inset 0 0 0 1px rgba(45, 156, 72, 0.18);
}
.cal-week-manage-item span:not(.cal-week-manage-actions) {
  min-width: 0;
  flex: 1;
}
.cal-week-manage-item strong {
  display: block;
  font-size: 0.76rem;
  color: var(--navy, #1F2C5C);
}
.cal-week-manage-item small {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.7rem;
  color: var(--ds-text-muted, #5b6b7c);
}
.cal-week-manage-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}
.cal-day-peek {
  width: 320px;
}
.cal-day-peek-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cal-event-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4.5rem 1rem 1rem;
  background: rgba(31, 44, 92, 0.08);
  z-index: 4;
}
.cal-event-popover {
  position: relative;
  width: 360px;
}
.cal-event-popover .empty-hint.form-hint-error {
  color: var(--color-error);
  background: rgba(193, 60, 60, 0.08);
  border-left: 3px solid var(--color-error);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin: 0.25rem 0 0;
}
.cal-event-popover-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cal-event-popover-header .cal-event-popover-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  margin-left: auto;
  flex: 0 0 auto;
}
.cal-event-popover-header .cal-event-popover-tools > .ui-tooltip-host {
  width: auto;
  margin-left: 0;
  flex: 0 0 auto;
}
.cal-event-popover-header .btn-icon-ghost {
  flex-shrink: 0;
}
.cal-event-title-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  padding: 0;
}
.cal-event-title-input:focus { outline: none; }
.cal-people { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cal-person {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  border: 0;
  background: var(--navy);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
}
.cal-person-add {
  background: var(--ds-surface-muted, #f2f4f8);
  color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--ds-border, #e2e6ee);
}
.cal-person-add.is-on {
  background: var(--navy);
  color: #fff;
  box-shadow: none;
}
.cal-people-search {
  width: 100%;
}
.cal-people-search .consultor-search-input-row input {
  min-height: 2.15rem;
  font-size: 0.8125rem;
}
.cal-month-count {
  display: none;
}
.cal-filters-backdrop {
  display: none;
}
.cal-aside-phone-head {
  display: none;
}

/* Tablet + phone: rail stays in-flow; expanded panel slides over the calendar */
@media (max-width: 1199px) {
  .cal-aside-wrap,
  .cal-aside-wrap.is-collapsed {
    width: 3.55rem;
    overflow: visible;
    transition: none;
  }
  .cal-aside-wrap .cal-aside,
  .cal-aside-wrap.is-collapsed .cal-aside {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 88vw);
    height: 100%;
    z-index: 8;
    box-shadow: 8px 0 32px rgba(31, 44, 92, 0.18);
    transform: translateX(-108%);
    transition: transform 0.22s ease;
    pointer-events: none;
    border-bottom-left-radius: var(--card-radius);
  }
  .cal-aside-wrap:not(.is-collapsed) {
    z-index: 8;
  }
  .cal-aside-wrap:not(.is-collapsed) .cal-aside {
    transform: translateX(0);
    pointer-events: auto;
  }
  .cal-aside-phone-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .cal-aside-phone-head .chart-filter-popover-title {
    flex: 1;
  }
  .cal-aside-phone-head > .ui-tooltip-host {
    width: auto;
    display: inline-flex;
    flex: 0 0 auto;
    margin-left: auto;
  }
  .cal-aside-toggle-tip.ui-tooltip-host {
    display: none;
  }
  .cal-filters-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(31, 44, 92, 0.35);
    border: 0;
    padding: 0;
    z-index: 7;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .cal-page:not(.is-aside-collapsed) .cal-filters-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

.cal-page.is-float-filters .cal-aside-wrap,
.cal-page.is-float-filters .cal-aside-wrap.is-collapsed {
  width: 3.55rem;
  overflow: visible;
  transition: none;
}
.cal-page.is-float-filters .cal-aside-wrap .cal-aside,
.cal-page.is-float-filters .cal-aside-wrap.is-collapsed .cal-aside {
  display: flex;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(300px, 88vw);
  height: 100%;
  z-index: 8;
  box-shadow: 8px 0 32px rgba(31, 44, 92, 0.18);
  transform: translateX(-108%);
  transition: transform 0.22s ease;
  pointer-events: none;
  border-bottom-left-radius: var(--card-radius);
}
.cal-page.is-float-filters .cal-aside-wrap:not(.is-collapsed) {
  z-index: 8;
}
.cal-page.is-float-filters .cal-aside-wrap:not(.is-collapsed) .cal-aside {
  transform: translateX(0);
  pointer-events: auto;
}
.cal-page.is-float-filters .cal-aside-phone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.cal-page.is-float-filters .cal-aside-toggle-tip.ui-tooltip-host {
  display: none;
}
.cal-page.is-float-filters .cal-filters-backdrop {
  display: block;
  position: absolute;
  inset: 0;
  background: rgba(31, 44, 92, 0.35);
  border: 0;
  padding: 0;
  z-index: 7;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.cal-page.is-float-filters:not(.is-aside-collapsed) .cal-filters-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Tablet: compact week grid */
@media (min-width: 721px) and (max-width: 1199px) {
  .page-content.module-layout:has(.cal-page) {
    padding: 12px;
    gap: 0.65rem;
  }
  .cal-toolbar {
    padding: 0.7rem 0.75rem 0.5rem;
  }
  .cal-toolbar-title {
    min-width: 6.5rem;
    font-size: 1rem;
  }
  .cal-week-grid {
    --cal-hour-h: 3rem;
  }
  .cal-grid,
  .cal-week-head,
  .cal-week-body {
    grid-template-columns: 2.85rem repeat(var(--cal-days, 7), minmax(0, 1fr));
  }
  .cal-month-week,
  .cal-month-cell {
    min-height: 5.2rem;
  }
  .cal-event-layer {
    padding: 3.5rem 0.75rem 0.75rem;
  }
}

/* Phone: compact calendar; collapsed rail stays in the layout */
@media (max-width: 720px) {
  .page-content.module-layout:has(.cal-page) {
    padding: 0.5rem 0.5rem 0.65rem;
    gap: 0.4rem;
  }
  .cal-page {
    min-height: 0;
    border-radius: 12px;
  }
  .cal-aside {
    padding: 0.75rem 0.85rem 1rem;
    gap: 0.7rem;
  }
  .cal-mini-day {
    aspect-ratio: auto;
    height: 1.7rem;
  }
  .cal-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title title"
      "views nav";
    gap: 0.4rem 0.35rem;
    align-items: center;
    padding: 0.65rem 0.7rem 0.5rem;
  }
  .cal-toolbar-title {
    grid-area: title;
    min-width: 0;
    font-size: 0.95rem;
  }
  .cal-views {
    grid-area: views;
  }
  .cal-toolbar-nav {
    grid-area: nav;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
  }
  .cal-toolbar-actions {
    grid-column: 1 / -1;
  }
  .cal-toolbar-actions .btn {
    flex: 1;
  }
  .cal-week-grid {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    --cal-hour-h: 2.75rem;
  }
  .cal-week-head,
  .cal-week-body {
    min-width: calc(3rem + var(--cal-days, 7) * 4.5rem);
    grid-template-columns: 3rem repeat(var(--cal-days, 7), minmax(4.5rem, 1fr));
  }
  .cal-grid {
    grid-template-columns: 3rem repeat(var(--cal-days, 7), minmax(0, 1fr));
  }
  .cal-week-times .cal-time,
  .cal-time {
    font-size: 0.62rem;
    padding: 0.25rem 0.15rem;
    white-space: nowrap;
  }
  .cal-head-wd {
    font-size: 0.62rem;
  }
  .cal-month-heads,
  .cal-month-week {
    min-width: 0;
  }
  .cal-month-head {
    font-size: 0.62rem;
    padding: 0.35rem 0;
  }
  .cal-month-week,
  .cal-month-cell {
    min-height: 3.35rem;
  }
  .cal-month-cell {
    padding: 0.2rem 0.15rem;
  }
  .cal-month-events {
    display: none;
  }
  .cal-month-week-spans {
    display: none;
  }
  .cal-month-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1rem;
    height: 1rem;
    margin-left: 0.1rem;
    padding: 0 0.22rem;
    border-radius: 999px;
    background: var(--green, #2D9C48);
    color: #fff;
    font-size: 0.56rem;
    font-weight: 800;
    vertical-align: middle;
  }
  .cal-event-layer {
    padding: 0.55rem 0.45rem 0.65rem;
    align-items: flex-end;
  }
  .cal-event-popover,
  .cal-choice-popover,
  .cal-day-peek {
    width: 100%;
    max-height: min(88vh, 40rem);
  }
}

.soi-score-body {
  padding: 0 1.125rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.soi-score-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 6px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.soi-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--gray-600);
}

.soi-stats strong {
  color: var(--text);
}

.soi-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  --soi-ring-color: var(--primary-2);
}

.soi-card.tone-warn { --soi-ring-color: #c9851a; }
.soi-card.tone-low { --soi-ring-color: #b45309; }
.soi-card.tone-idle { --soi-ring-color: #6b7c93; }
.soi-card.tone-mid { --soi-ring-color: #3d6b8c; }
.soi-card.tone-good { --soi-ring-color: var(--primary-2); }

.soi-card .ds-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.soi-card-actions {
  flex-shrink: 0;
}

.soi-card .soi-card-actions .btn-filter-chart {
  width: 28px;
  height: 28px;
}

.soi-status-pill {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.08);
  color: var(--navy);
}

.soi-status-pill.status-warn,
.soi-status-pill.status-low {
  background: rgba(201, 133, 26, 0.14);
  color: #8a5a10;
}

.soi-status-pill.status-good {
  background: var(--green-muted);
  color: var(--green-dark, #268a3e);
}

.soi-status-pill.status-mid {
  background: rgba(61, 107, 140, 0.14);
  color: #2a4d66;
}

.soi-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(0.35rem, 1.8cqh, 0.75rem);
  padding: 0 0 clamp(0.25rem, 1.2cqh, 0.65rem);
  min-height: 0;
  overflow: hidden;
}

.soi-quarter-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  flex: 0 0 auto;
}

.soi-quarter-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.28rem 0.2rem;
}

.soi-quarter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2D9C48;
  flex-shrink: 0;
}

.soi-quarter-tabs button.active .soi-quarter-dot {
  background: #fff;
}

.soi-card-body > .ui-tooltip-host,
.soi-bars > .ui-tooltip-host {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  align-items: stretch;
}

.soi-bars > .ui-tooltip-host {
  flex: 1 1 auto;
}

.soi-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "ring copy"
    "insight insight";
  align-items: center;
  column-gap: clamp(0.45rem, 2.4cqi, 0.85rem);
  row-gap: clamp(0.2rem, 1.1cqh, 0.4rem);
  flex: 0 0 auto;
  min-width: 0;
}

.soi-activation-ring {
  grid-area: ring;
  width: clamp(44px, 16cqi + 6cqh, 76px);
  height: clamp(44px, 16cqi + 6cqh, 76px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(31, 44, 92, 0.06);
}

.soi-activation-core {
  width: 74%;
  height: 74%;
  border-radius: 50%;
  background: var(--ds-surface, #fff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}

.soi-activation-core strong {
  font-size: clamp(0.78rem, 3.4cqi + 1.1cqh, 1.05rem);
  color: var(--navy);
}

.soi-activation-core span {
  font-size: clamp(0.5rem, 2cqi, 0.5625rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.soi-hero-copy {
  grid-area: copy;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.soi-hero-metric strong {
  display: block;
  font-size: clamp(0.92rem, 3.6cqi + 1.2cqh, 1.2rem);
  line-height: 1.1;
  color: var(--navy);
}

.soi-hero-metric span {
  font-size: clamp(0.6rem, 2.4cqi, 0.6875rem);
  color: var(--gray-600);
}

.soi-insight {
  grid-area: insight;
  margin: 0;
  font-size: clamp(0.6rem, 2.2cqi + 0.4cqh, 0.6875rem);
  line-height: 1.3;
  color: var(--gray-600);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.soi-bars {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: clamp(0.22rem, 1.4cqh, 0.5rem);
  overflow: auto;
}

.soi-bar-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.1rem, 0.7cqh, 0.22rem);
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.soi-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.6875rem;
  color: var(--gray-600);
}

.soi-bar-label strong {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.soi-bar-label small {
  font-weight: 600;
  color: var(--gray-500);
}

.soi-bar-track {
  width: 100%;
  height: clamp(4px, 1.6cqh, 8px);
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.08);
  overflow: hidden;
}

.soi-bar-fill {
  height: 100%;
  border-radius: inherit;
  min-width: 0;
  transition: width 0.25s ease;
}

.soi-bar-fill.is-ref {
  background: linear-gradient(90deg, #3d6b8c, #1f2c5c);
}

.soi-bar-fill.is-opp {
  background: linear-gradient(90deg, #53af3b, #2d9c48);
}

.soi-bar-fill.is-low { background: #b45309; }
.soi-bar-fill.is-warn,
.soi-bar-fill.is-mid { background: #c9851a; }
.soi-bar-fill.is-good { background: linear-gradient(90deg, #53af3b, #2d9c48); }
.soi-bar-fill.is-idle,
.soi-bar-fill.is-off { background: transparent; }

@container dash-card (max-height: 26rem) {
  .soi-insight {
    -webkit-line-clamp: 1;
  }
}

@container dash-card (max-height: 20rem) {
  .soi-insight {
    display: none;
  }
}

@container dash-card (max-height: 16.5rem) {
  .soi-hero-metric span {
    display: none;
  }
  .soi-bar-label {
    font-size: 0.625rem;
  }
}

.soi-status-pill.status-low {
  background: rgba(180, 83, 9, 0.16);
  color: #9a3412;
}

.soi-scorecard-wrap {
  overflow: auto;
}

.soi-scorecard {
  min-width: 920px;
}

.soi-scorecard th,
.soi-scorecard td {
  vertical-align: top;
}

.soi-scorecard-person {
  font-weight: 600;
  white-space: nowrap;
}

.soi-quarter {
  min-width: 168px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  container-type: inline-size;
  container-name: soi-quarter;
}

.soi-quarter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.soi-gro {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.08);
}

.soi-gro-idle { color: var(--gray-500); }
.soi-gro-low { color: #9a3412; background: rgba(180, 83, 9, 0.14); }
.soi-gro-warn { color: #8a5a10; background: rgba(201, 133, 26, 0.16); }
.soi-gro-good { color: var(--green-dark, #268a3e); background: var(--green-muted); }

.soi-quarter-metrics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.soi-scorecard-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.1rem;
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  background: rgba(31, 44, 92, 0.05);
  color: var(--gray-600);
  font-size: 0.75rem;
  line-height: 1.35;
}

.soi-scorecard-legend strong {
  color: var(--navy);
  font-weight: 700;
  margin-right: 0.28rem;
}

.soi-quarter-metrics li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label gro"
    "pair pair";
  gap: 0.12rem 0.4rem;
  align-items: baseline;
  font-size: 0.6875rem;
  color: var(--gray-600);
}

.soi-quarter-metrics li > .soi-metric-label { grid-area: label; min-width: 0; }
.soi-quarter-metrics li > .ui-tooltip-host:has(.soi-metric-pair),
.soi-quarter-metrics li > .soi-metric-pair { grid-area: pair; }
.soi-quarter-metrics li > .ui-tooltip-host:has(em),
.soi-quarter-metrics li > em { grid-area: gro; justify-self: end; }

.soi-quarter-metrics li > .ui-tooltip-host {
  width: auto;
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
}

.soi-quarter-metrics-head {
  padding-bottom: 0.2rem;
  margin-bottom: 0.1rem;
  border-bottom: 1px solid var(--ds-border, var(--gray-200));
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.5625rem;
}

.soi-quarter-metrics-head strong,
.soi-quarter-metrics-head em {
  font-size: inherit;
  font-weight: 600;
  color: inherit;
  background: none;
  padding: 0;
}

.soi-metric-pair {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  min-width: max-content;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@container soi-quarter (min-width: 16.75rem) {
  .soi-quarter-metrics li {
    grid-template-columns: minmax(4.2rem, 1fr) max-content auto;
    grid-template-areas: "label pair gro";
    align-items: baseline;
  }
}

.soi-metric-slash {
  color: var(--gray-400);
  font-weight: 600;
}

.soi-quarter-metrics strong {
  color: var(--navy);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.soi-quarter-metrics em {
  font-style: normal;
  font-weight: 700;
  font-size: 0.6875rem;
  justify-self: end;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.06);
}

.soi-edit-context {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
}

.module-card {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
}

.data-table th {
  background: var(--ds-surface-muted);
  color: var(--brand-navy);
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--ds-border);
}

.data-table tr:hover td {
  background: var(--ds-surface-muted);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

@media (max-width: 1200px) {
  .kpi-row-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-main-grid { grid-template-columns: 1fr; }
  .dashboard-bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .kpi-row-v2 { grid-template-columns: 1fr; }
}

.card-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 0.75rem;
}

.card-loading .loading-spinner {
  padding: 0.5rem;
  gap: 0.35rem;
}

.card-loading .loading-spinner-gif {
  width: 40px;
}

.card-loading .loading-spinner-text {
  font-size: 0.75rem;
}

.kpi-card-v2 .card-loading {
  min-height: 56px;
  padding: 0.25rem 0;
}

/* ── DataGrid (Power BI-style) ── */
.data-grid {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0.5rem;
}

.module-card-table.is-refreshing .data-grid,
.module-page-table.is-refreshing .data-grid {
  opacity: 0.72;
  transition: opacity 0.15s ease;
}

.data-grid-refresh-hint {
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.data-grid-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem 0;
  position: relative;
  flex-shrink: 0;
}

.data-grid-toolbar .btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.data-grid-search {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 160px;
  max-width: 320px;
  border: 1px solid var(--ds-border);
  border-radius: 8px;
  background: var(--ds-surface);
  padding: 0.4rem 0.65rem;
  min-height: 2.25rem;
  color: var(--ds-text-muted);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.data-grid-search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-muted);
}

.data-grid-search input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--text);
}

.data-grid-search-clear {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--gray-500);
  display: inline-flex;
  align-items: center;
}

.data-grid-chooser {
  position: absolute;
  top: 100%;
  left: 0.75rem;
  z-index: 40;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(25, 24, 71, 0.12);
  padding: 0.75rem;
  max-height: 280px;
  overflow: auto;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.data-grid-chooser-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.data-grid-chooser-path {
  color: var(--gray-500);
  font-style: normal;
  font-size: 0.7rem;
}

.data-grid-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overflow-x: auto;
}

.data-grid-table,
.data-grid-table.data-grid-table-autofit {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
  max-width: none;
  border-collapse: separate;
  border-spacing: 0;
}

.data-grid-table th,
.data-grid-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.data-grid-table th.col-acoes,
.data-grid-table td.col-acoes {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.data-grid-row-drag-th {
  width: 52px;
  min-width: 52px;
  text-align: center;
  color: #94a3b8;
}

.data-grid-row-drag-td {
  width: 52px;
  min-width: 52px;
  max-width: 52px !important;
  text-align: center;
  vertical-align: middle;
}

.data-grid-row-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: grab;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  line-height: 1;
}

.data-grid-row-drag-handle:hover {
  background: #e2e8f0;
  color: #334155;
}

.data-grid-row-drag-handle:active {
  cursor: grabbing;
}

.data-grid-row-drag-index {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
  min-width: 1.1em;
}

.data-grid-table tr.row-dragging td {
  opacity: 0.45;
  background: #f1f5f9 !important;
}

.data-grid-table tr.row-drag-over td {
  box-shadow: inset 0 2px 0 #3b82f6;
}

.settings-columns-page .data-table tbody tr {
  cursor: default;
}

.data-grid-th {
  position: relative;
  user-select: none;
  vertical-align: middle;
  overflow: hidden;
  font-family: var(--font-heading);
  color: var(--brand-navy);
  /* Prevent long header labels from expanding content-sized columns */
  white-space: nowrap;
  box-sizing: border-box;
}

.data-grid-th.is-filtered {
  background: rgba(45, 156, 72, 0.08);
}

.data-grid-th-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding-right: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.data-grid-th-label {
  font-weight: 700;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-grid-th-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  color: var(--gray-500);
}

.data-grid-th-menu-btn {
  border: none;
  background: transparent;
  padding: 0.15rem;
  border-radius: 4px;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
}

.data-grid-th-menu-btn:hover {
  background: var(--gray-100);
  color: var(--text);
}

.data-grid-sort-btn {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
  width: calc(100% - 8px);
}

.data-grid-resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  z-index: 2;
}

.data-grid-resize:hover {
  background: rgba(45, 156, 72, 0.35);
}

.data-grid-col-menu {
  position: fixed;
  z-index: 10000;
  min-width: 240px;
  max-width: 280px;
  max-height: min(420px, calc(100vh - 16px));
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(25, 24, 71, 0.18);
  padding: 0.35rem 0;
  text-align: left;
  color: var(--text, #0f172a);
}

.data-grid-col-menu-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--gray-100);
}

.data-grid-col-menu-section:first-child {
  border-top: none;
}

.data-grid-col-menu-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
}

.data-grid-col-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  background: transparent;
  padding: 0.4rem 0.25rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.data-grid-col-menu-item:hover:not(:disabled) {
  background: var(--gray-50);
}

.data-grid-col-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.data-grid-menu-input {
  width: 100%;
  min-height: 2rem;
  box-sizing: border-box;
  border: 1px solid var(--ds-border, var(--gray-300));
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-family: var(--font-body, inherit);
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--ds-surface, #fff);
  color: var(--brand-navy, var(--navy, #1F2C5C));
  outline: none;
  opacity: 1;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.data-grid-menu-input:hover {
  border-color: rgba(45, 156, 72, 0.45);
  background-color: rgba(45, 156, 72, 0.04);
}
.data-grid-menu-input:focus {
  border-color: var(--accent, #2D9C48);
  box-shadow: 0 0 0 3px rgba(45, 156, 72, 0.16);
}

.data-grid-menu-logic {
  max-width: 5rem;
  align-self: flex-start;
}

.data-grid-col-menu-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.data-grid-filter-row th {
  padding: 0.35rem 0.5rem;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}

.data-grid-filter-input {
  width: 100%;
  min-width: 0;
  min-height: 2rem;
  box-sizing: border-box;
  font-family: var(--font-body, inherit);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--ds-border, var(--gray-300));
  border-radius: 8px;
  background: var(--ds-surface, #fff);
  color: var(--brand-navy, var(--navy, #1F2C5C));
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.data-grid-filter-input:hover {
  border-color: rgba(45, 156, 72, 0.45);
  background-color: rgba(45, 156, 72, 0.04);
}
.data-grid-filter-input:focus {
  border-color: var(--accent, #2D9C48);
  box-shadow: 0 0 0 3px rgba(45, 156, 72, 0.16);
}

.data-grid td .app-select,
.data-grid td .data-grid-select {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  gap: 0;
}
.data-grid td .app-select-trigger {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* ── Faturação page (split master-detail) ── */
.faturacao-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  gap: 0.75rem;
  padding: 0.75rem 1rem 1rem;
  overflow: hidden;
  background: var(--ds-surface-muted, #efefef);
}

.faturacao-page > .module-page-shell {
  flex: 1;
  min-height: 0;
}

.page-body:has(.faturacao-page) {
  background: var(--ds-surface-muted, #efefef);
  flex-direction: column;
}

.faturacao-split {
  display: grid;
  grid-template-columns: minmax(320px, 42%) minmax(360px, 58%);
  gap: 1rem;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  align-items: stretch;
  overflow: hidden;
}

.module-page-shell-split .module-page-shell-body {
  padding: 0;
}

.module-page-shell-split .faturacao-split {
  padding: 0.75rem;
  height: auto;
}

.faturacao-pedidos-col {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.faturacao-pedidos-col .generic-list-embedded {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: 0.5rem 0.75rem 0.75rem;
  gap: 0.5rem;
  overflow: hidden;
}

.faturacao-pedidos-col .mediacao-toolbar {
  flex-wrap: wrap;
  gap: 0.4rem;
}

.faturacao-pedidos-col .mediacao-toolbar input {
  min-width: 120px;
  flex: 1 1 120px;
}

.faturacao-pedidos-col .mediacao-toolbar select {
  min-width: 132px;
  max-width: 180px;
  flex: 0 1 auto;
}

.faturacao-pedidos-col .mediacao-toolbar-card {
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  flex: 0 0 auto;
}

.faturacao-pedidos-col .module-card-table {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
}

.faturacao-pedidos-col .data-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.faturacao-pedidos-col .data-grid-toolbar {
  flex: 0 0 auto;
}

.faturacao-pedidos-col .data-grid-scroll,
.faturacao-pedidos-col .data-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: auto !important;
  overscroll-behavior: contain;
}

.faturacao-pedidos-col .pagination {
  flex-shrink: 0;
  margin-top: 0.35rem;
}

.faturacao-pedidos-col .data-grid-table {
  min-width: 820px;
}

.faturacao-pedidos-col .data-table th,
.faturacao-pedidos-col .data-table td {
  padding: 0.5rem 0.75rem;
}

.faturacao-dossier-col {
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.faturacao-dossier-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  flex: 1;
  min-height: 0;
  color: var(--gray-600);
}

.faturacao-dossier-empty h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

.faturacao-dossier-empty p {
  margin: 0;
  font-size: 0.875rem;
  max-width: 280px;
}

.faturacao-dossier-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.faturacao-dossier-sub {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--gray-600);
  font-weight: 500;
}

.faturacao-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.625rem;
  padding: 0.875rem 1rem 0;
  flex-shrink: 0;
}

.faturacao-kpi-card {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.faturacao-kpi-label {
  font-size: 0.6875rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.faturacao-kpi-card strong {
  font-size: 0.9375rem;
  color: var(--navy);
}

.faturacao-dossier-panel .faturacao-dossier-body {
  overflow: auto;
  padding: 0.875rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faturacao-dossier-card-wide {
  width: 100%;
  min-width: 0;
}

.faturacao-dossier-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

@media (max-width: 900px) {
  .faturacao-dossier-row {
    grid-template-columns: 1fr;
  }
}

/* Legacy fixed drawer — kept for reference, unused */
.faturacao-dossier {
  position: fixed;
  left: var(--sidebar-width, 240px);
  right: 0;
  bottom: 0;
  max-height: min(52vh, 520px);
  z-index: 80;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -12px 32px rgba(25, 24, 71, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.faturacao-dossier-panel .faturacao-dossier-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.125rem;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
  background: var(--gray-50);
}

.faturacao-dossier-header h3 {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--navy);
  line-height: 1.3;
}

.faturacao-dossier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.faturacao-dossier-body {
  overflow: auto;
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faturacao-dossier-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1rem 1.125rem;
  min-width: 0;
}

.faturacao-dossier-card h4 {
  margin: 0 0 0.875rem;
  font-size: 0.875rem;
  color: var(--navy);
  font-weight: 700;
}

.faturacao-dossier-card .data-grid {
  max-height: none;
  min-height: 0;
}

.faturacao-dossier-card .data-grid-table {
  min-width: 640px;
}

.faturacao-dossier-card .data-table th,
.faturacao-dossier-card .data-table td {
  padding: 0.5rem 0.75rem;
}

.faturacao-dl {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.faturacao-dl > div {
  display: grid;
  grid-template-columns: minmax(100px, 38%) 1fr;
  gap: 0.75rem;
  font-size: 0.8125rem;
  align-items: start;
  padding: 0.15rem 0;
}

.faturacao-dl dt {
  color: var(--gray-600);
  font-weight: 500;
}

.faturacao-dl dd {
  margin: 0;
  color: var(--navy);
  font-weight: 600;
  word-break: break-word;
}

.faturacao-erp-card {
  width: 100%;
}

.faturacao-erp-line {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--white);
  font-size: 0.8125rem;
}

.faturacao-erp-line + .faturacao-erp-line {
  margin-top: 0.625rem;
}

.faturacao-erp-line-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.faturacao-erp-line-head strong {
  color: var(--navy);
  font-size: 0.875rem;
  line-height: 1.35;
}

.faturacao-erp-dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1rem;
  margin: 0;
}

.faturacao-erp-dl > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.5rem;
  align-items: start;
}

.faturacao-erp-dl dt {
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.75rem;
}

.faturacao-erp-dl dd {
  margin: 0;
  color: var(--navy);
  font-weight: 600;
  word-break: break-word;
}

.faturacao-erp-line:last-child {
  border-bottom: none;
}

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

@media (max-width: 1200px) {
  .faturacao-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 48vh) minmax(280px, 1fr);
  }

  .faturacao-erp-dl {
    grid-template-columns: 1fr;
  }
}

/* ── Carteira Matching (oportunidade → ativos) ── */
.page-body:has(.matching-page) {
  background: var(--white);
  flex-direction: column;
}

.matching-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  gap: 0.75rem;
  padding: 0.75rem 1rem 1rem;
  overflow: hidden;
}

.matching-page > .module-card-tabs {
  flex-shrink: 0;
}

.matching-split {
  display: grid;
  grid-template-columns: minmax(220px, 30%) minmax(280px, 70%);
  gap: 1rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.matching-split-resizable {
  grid-template-columns: minmax(220px, 30%) 8px minmax(280px, 1fr);
  gap: 0.45rem;
}

.matching-split-handle-tip.ui-tooltip-host {
  display: block;
  width: 8px;
  height: 100%;
  min-width: 0;
  align-self: stretch;
}

.matching-split-handle {
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  border-radius: 999px;
  background: transparent;
}

.matching-split-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 3rem;
  border-radius: 999px;
  background: var(--gray-200);
}

.matching-split-handle:hover::after,
.matching-split-handle:focus-visible::after,
.matching-split.is-resizing .matching-split-handle::after {
  background: var(--accent, #2D9C48);
}

.matching-split.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.matching-split.is-resizing * {
  cursor: col-resize;
  user-select: none;
}

.matching-split-embedded {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.module-page-shell-body:has(.matching-split-embedded) {
  padding: 0.75rem;
  background: var(--ds-surface-muted, #f3f4f6);
}

.matching-oportunidades-col,
.matching-ativos-col {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.matching-oportunidades-col .list-totals-cards,
.matching-oportunidades-col .list-totals-cards.n-2 {
  margin-bottom: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.matching-oportunidades-col .list-totals-card.dash-card-v2 {
  min-height: 5.1rem;
  padding: 0.55rem 0.6rem;
}

.matching-oportunidades-col .generic-list-embedded {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  padding: 0.5rem 0.75rem 0.75rem;
  gap: 0.5rem;
  overflow: hidden;
}

.matching-oportunidades-col .mediacao-toolbar-card {
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  flex: 0 0 auto;
}

.matching-oportunidades-col .module-card-table,
.matching-oportunidades-col .data-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.matching-oportunidades-col .data-grid-scroll,
.matching-oportunidades-col .data-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto !important;
}

.matching-oportunidades-col .module-page-shell-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: transparent;
}

.matching-oportunidades-col .module-page-table,
.matching-oportunidades-col .module-page-table-cards {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.matching-oportunidades-col .data-list-cards {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.5rem;
  gap: 0.5rem;
}

.matching-oportunidades-col .data-list-card {
  padding: 0.7rem 0.85rem;
}

.matching-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 2rem;
  text-align: center;
  color: var(--gray-600);
}

.matching-empty h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.05rem;
}

.matching-empty p {
  margin: 0;
  max-width: 28rem;
  line-height: 1.45;
  font-size: 0.875rem;
}

.matching-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.matching-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.matching-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.matching-panel-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy);
}

.matching-panel-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.matching-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem 0.35rem;
}

.matching-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 600;
}

.matching-criteria {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 0.5rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.matching-criteria-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--navy);
  cursor: pointer;
  user-select: none;
}

.matching-panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.matching-empty-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  color: var(--gray-600);
  text-align: center;
  font-size: 0.875rem;
}

.matching-card {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: linear-gradient(180deg, #fbfcfd 0%, var(--white) 100%);
}

.matching-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.matching-card-title {
  font-size: 0.875rem;
  color: var(--navy);
  line-height: 1.3;
}

.matching-score {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.matching-score-high {
  background: rgba(45, 156, 72, 0.14);
  color: var(--green-dark);
}

.matching-score-mid {
  background: rgba(242, 201, 76, 0.22);
  color: #8a6a00;
}

.matching-score-low {
  background: var(--gray-100);
  color: var(--gray-600);
}

.matching-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--gray-600);
}

.matching-card-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.22rem 0.65rem;
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
}

.matching-card-field {
  display: contents;
}

.matching-card-field dt {
  color: var(--gray-600);
  font-weight: 600;
}

.matching-card-field dd {
  margin: 0;
  color: var(--navy);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matching-panel-body-table {
  padding: 0;
  gap: 0;
}

.matching-panel-body-table .data-grid,
.matching-panel-body-table .data-table-wrap,
.matching-panel-body-table .data-grid-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.matching-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.matching-reason {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--gray-100);
  color: var(--navy);
}

.inv-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
}

.inv-choice-grid .dash-prob-chip {
  margin: 0;
  background: #fff;
  flex: 0 0 auto;
}

.inv-choice-grid .dash-prob-chip.active {
  background: #1F2C5C;
  border-color: #1F2C5C;
  color: #fff;
}

.inv-choice-grid-scroll {
  max-height: 10rem;
  overflow: auto;
  padding: 0.5rem;
}

.inv-clientes-picker input[type="search"] {
  margin-bottom: 0.5rem;
}

.inv-choice-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: #1F2C5C;
  cursor: pointer;
  user-select: none;
}

.range-slider {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem 0.85rem;
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
}

.range-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.range-slider-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy, #1F2C5C);
}

.range-slider-value {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--navy, #1F2C5C);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.range-slider-sep {
  color: rgba(31, 44, 92, 0.55);
}

.range-slider-num,
.form-group .range-slider-num:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.negocio-modal-body .form-group .range-slider-num:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) {
  width: auto;
  min-width: 4.25rem;
  max-width: 9.5rem;
  min-height: 1.7rem;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  color: #1F2C5C;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.range-slider-num:focus,
.form-group .range-slider-num:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
.negocio-modal-body .form-group .range-slider-num:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus {
  border-color: #2D9C48;
  box-shadow: 0 0 0 3px rgba(45, 156, 72, 0.18);
  outline: none;
}

.range-slider-bump {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  background: #fff;
  color: #1F2C5C;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.range-slider-bump:hover,
.range-slider-bump:focus-visible {
  border-color: #2D9C48;
  color: #2D9C48;
  outline: none;
}

.range-slider-control {
  position: relative;
  height: 22px;
}

.range-slider-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  background: rgba(31, 44, 92, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.range-slider-fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: #2D9C48;
  border-radius: 999px;
}

.range-slider-control input[type="range"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 22px;
  margin: 0;
  background: none;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
}

.negocio-modal-body .form-group .range-slider-control input[type="range"] {
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
}

.range-slider-control input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
}

.range-slider-control input[type="range"]::-moz-range-track {
  height: 8px;
  background: transparent;
  border: 0;
}

.range-slider-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  margin-top: -4px;
  border-radius: 50%;
  background: #1F2C5C;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(31, 44, 92, 0.28);
  cursor: pointer;
}

.range-slider-control input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1F2C5C;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(31, 44, 92, 0.28);
  cursor: pointer;
}

.inv-wizard .segmented-control {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inv-wizard .negocio-modal-grid-auto > .form-group:nth-child(2) {
  grid-column: 1 / -1;
}

.inv-wizard .segmented-option {
  font-size: 0.75rem;
  padding: 0.5rem 0.35rem;
}

.location-address-field {
  position: relative;
}

.location-address-field input,
.form-group .location-address-field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.negocio-modal-body .form-group .location-address-field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]) {
  padding-left: 2.4rem;
}

.location-address-ico {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: #1F2C5C;
  opacity: 0.72;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inv-clientes-picker input[type="search"] {
  margin-bottom: 0.5rem;
}

.inv-wizard .matching-card {
  margin-bottom: 0.65rem;
}

@media (max-width: 1200px) {
  .matching-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 48vh) minmax(280px, 1fr);
  }

  .matching-split-handle,
  .matching-split-handle-tip {
    display: none;
  }
}

/* ── Settings grid columns editor ── */
.grid-columns-editor {
  margin-top: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 0.875rem;
  background: var(--gray-100);
}

.grid-columns-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.grid-columns-editor-table-wrap {
  max-height: 360px;
  overflow: auto;
  background: var(--white);
  border-radius: 8px;
}

.grid-columns-preview {
  font-size: 0.75rem;
  color: var(--gray-600);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Settings as full page (same patterned module template) ── */
.page-content.settings-page {
  /* inherit .module-layout padding / transparent bg so the H pattern shows */
  overflow: hidden;
}

.settings-page-shell.module-page-shell {
  flex: 1;
  min-height: 0;
}

.settings-page-shell > .module-page-shell-body {
  padding: 0;
  background: var(--ds-surface, #fff);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.settings-page-tabs {
  padding: 0;
  flex-shrink: 0;
  border-bottom: none;
}

.settings-page-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1.25rem 1.5rem;
  background: var(--ds-surface-muted, #f3f4f6);
}

.settings-page-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  background: var(--ds-surface, #fff);
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
}

.settings-prefs-msg {
  margin: 0 auto 0 0;
  font-size: 0.8125rem;
  color: var(--green);
  font-weight: 600;
}

.settings-prefs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 720px;
}

.settings-prefs-card {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  background: var(--gray-100);
}

.settings-prefs-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--navy);
}

.settings-prefs-dl {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.settings-prefs-dl > div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.settings-prefs-dl dt {
  margin: 0;
  color: var(--gray-600);
  font-weight: 600;
}

.settings-prefs-dl dd {
  margin: 0;
  color: var(--navy);
}

.settings-prefs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.settings-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  color: var(--navy);
  cursor: pointer;
}

.settings-check input {
  margin-top: 0.15rem;
}

.settings-columns-page {
  padding-top: 0.75rem;
}

.phone-card-mapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
  align-items: flex-start;
  margin: 0 0 1.15rem;
  padding: 1rem 1.1rem;
  background: var(--ds-surface, #fff);
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: 12px;
  flex-shrink: 0;
}

.phone-card-mapper-copy {
  flex: 1 1 220px;
  min-width: 0;
}

.phone-card-mapper-copy h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--brand-navy, var(--navy));
}

.phone-card-mapper-copy p {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--gray-600);
  max-width: 28rem;
  line-height: 1.45;
}

.phone-card-mapper-card {
  width: min(100%, 380px);
  cursor: default;
  flex: 0 0 auto;
}

.phone-card-mapper-slot {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.phone-card-mapper-slot.is-title {
  margin-bottom: 0.5rem;
}

.phone-card-mapper-select {
  width: 100%;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--gray-600);
  border: 1px dashed var(--gray-300);
  border-radius: 8px;
  background: var(--gray-100, #f3f4f6);
  padding: 0.28rem 0.45rem;
  min-height: 32px;
}

.phone-card-mapper-placeholder {
  color: var(--gray-400);
}

.phone-card-mapper-card .data-list-card-title {
  margin: 0.15rem 0 0;
}

.phone-card-mapper-card .data-list-card-meta-row dd {
  margin-top: 0.1rem;
}

.settings-columns-hint {
  margin: 0 0 0.75rem;
  max-width: 72rem;
}

.settings-columns-grid-card {
  flex: 1;
  min-height: 0;
}

.settings-campo-code {
  font-size: 0.75rem;
  word-break: break-all;
}

.origem-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.origem-badge.system {
  background: #eef1f6;
  color: #475569;
}

.origem-badge.custom {
  background: rgba(45, 156, 72, 0.12);
  color: #1f7a35;
}

.page-content.module-layout.perfil-page,
.perfil-page {
  gap: 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-content: flex-start;
}

.perfil-resume {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 960px;
  width: 100%;
  flex-shrink: 0;
}

.perfil-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.perfil-hero-photo {
  flex-shrink: 0;
}

.perfil-avatar-frame {
  position: relative;
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.perfil-avatar-frame.has-ring {
  width: 128px;
  height: 128px;
}

.perfil-avatar-frame .commission-ring-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.perfil-avatar-frame .consultor-card-avatar,
.perfil-avatar-frame .member-avatar,
.perfil-avatar-frame img {
  position: relative;
  z-index: 1;
}

.perfil-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.perfil-hero-copy h2 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--navy);
  line-height: 1.2;
}

.perfil-role {
  margin: 0.25rem 0 0.55rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.perfil-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.perfil-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgba(31, 44, 92, 0.08);
  color: var(--navy);
}

.perfil-chip.tone-estado {
  background: var(--green-muted);
  color: var(--green-dark, #268a3e);
}

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

.perfil-card {
  padding: 1.125rem 1.25rem 1.25rem;
}

.perfil-card h3 {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--navy);
}

.perfil-card-wide {
  grid-column: 1 / -1;
}

.perfil-card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.perfil-card-head-row h3 {
  margin: 0;
}

.perfil-ano-select {
  min-width: 5.5rem;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  background: var(--ds-surface, #fff);
  color: var(--navy);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0 0.5rem;
}

.comissao-dash-card {
  height: 100%;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.comissao-dash-year {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-600);
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.06);
}

.comissao-dash-demo-pill {
  margin-left: 0.35rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-green, #2d9c48);
  background: rgba(45, 156, 72, 0.12);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.comissao-dash-explore {
  font-size: 0.75rem;
}

.comissao-dash-footer {
  margin-top: auto;
  padding: 0.15rem var(--ds-content-pad, 1.125rem) 0.75rem;
  border-top: none;
  align-items: center;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.comissao-dash-footer-meta {
  flex: 1;
  min-width: 0;
}

.comissao-dash-body {
  padding: 0 var(--ds-content-pad, 1.125rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.comissao-dash-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.comissao-dash-metrics > div {
  min-width: 0;
  text-align: center;
}

.comissao-dash-metrics > div:first-child {
  text-align: left;
}

.comissao-dash-metrics > div:last-child {
  text-align: right;
}

.comissao-dash-metrics strong {
  display: block;
  font-size: 0.95rem;
  color: var(--brand-navy, var(--navy));
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comissao-dash-card .perfil-progress-block {
  width: 100%;
  box-sizing: border-box;
}

.comissao-dash-card .perfil-hint {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--gray-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.perfil-metric-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 0.2rem;
}

.perfil-commission-hero {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.perfil-commission-hero strong {
  font-size: 0.95rem;
  color: var(--navy);
}

.perfil-progress-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.perfil-progress-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-600);
}

.perfil-progress-label-row strong {
  font-size: 0.8125rem;
  color: var(--brand-navy, var(--navy));
  font-variant-numeric: tabular-nums;
}

.perfil-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(31, 44, 92, 0.08);
  overflow: hidden;
}

.perfil-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #53af3b, #2d9c48);
}

.perfil-progress-fill--plano {
  background: linear-gradient(90deg, #3d6b8c, #1f2c5c);
}

.perfil-progress-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.perfil-progress-ends {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-600);
  font-variant-numeric: tabular-nums;
}

.perfil-hint {
  margin: 0.55rem 0 0;
  font-size: 0.6875rem;
  color: var(--gray-600);
}

.perfil-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 820px) {
  .perfil-hero {
    flex-direction: column;
    text-align: center;
  }
  .perfil-hero-chips {
    justify-content: center;
  }
  .perfil-grid {
    grid-template-columns: 1fr;
  }
  .perfil-commission-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .comissao-dash-metrics {
    grid-template-columns: 1fr;
  }
}

/* ── Responsive: phone list cards + view toggle ── */
.phone-list-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
}

.phone-list-view-toggle .ui-tooltip-host,
.list-view-tip.ui-tooltip-host {
  display: inline-flex;
  width: auto;
  min-width: 0;
}

.phone-view-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px !important;
  border: none !important;
  background: transparent !important;
  color: var(--gray-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.phone-view-btn.active,
.toolbar-icon-btn.phone-view-btn.active {
  background: var(--white) !important;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(25, 24, 71, 0.12);
}

.data-list-cards {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  padding: 0.65rem;
  overflow: auto;
  min-height: 0;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.data-list-cards-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--gray-600);
}

.data-list-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
  overflow: visible;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.data-list-card:hover,
.data-list-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.data-list-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.data-list-card-body {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}

.data-list-card-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  word-break: break-word;
}

.data-list-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  margin: 0;
  align-content: start;
}

.data-list-card-meta-row {
  min-width: 0;
  overflow: visible;
}

.data-list-card-meta-row dt {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--gray-600);
  margin: 0;
  line-height: 1.3;
}

.data-list-card-meta-row dd {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
  overflow: visible;
}

.data-list-card-meta-row dd .status-badge {
  max-width: 100%;
  white-space: normal;
}

.data-list-card-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: 0.1rem;
}

.data-list-card-actions .btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.module-page-table-cards {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.module-page-table-cards .data-list-cards {
  flex: 1 1 auto;
}

.module-page-table-cards .pagination {
  flex-shrink: 0;
}

/* Dual-pane phone master-detail */
.phone-back-btn {
  display: none;
}

@media (max-width: 720px) {
  .faturacao-split.phone-master-detail,
  .matching-split.phone-master-detail {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100%;
    min-height: 0;
  }

  .faturacao-split.phone-master-detail:not(.phone-show-detail) .faturacao-dossier-col,
  .matching-split.phone-master-detail:not(.phone-show-detail) .matching-ativos-col {
    display: none;
  }

  .faturacao-split.phone-master-detail.phone-show-detail .faturacao-pedidos-col,
  .matching-split.phone-master-detail.phone-show-detail .matching-oportunidades-col {
    display: none;
  }

  .faturacao-split.phone-master-detail .faturacao-pedidos-col,
  .faturacao-split.phone-master-detail .faturacao-dossier-col,
  .matching-split.phone-master-detail .matching-oportunidades-col,
  .matching-split.phone-master-detail .matching-ativos-col {
    min-height: 0;
    height: 100%;
    overflow: auto;
  }

  .phone-back-btn {
    display: inline-flex !important;
  }
}

@media (min-width: 721px) and (max-width: 1199px) {
  .faturacao-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 40vh) minmax(220px, 1fr);
  }

  .matching-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 40vh) minmax(220px, 1fr);
  }

  .matching-split-handle,
  .matching-split-handle-tip {
    display: none;
  }
}

/* Scrollable segmented tabs on narrow viewports — hug the pills, do not stretch */
@media (max-width: 1199px) {
  .tabs-segmented {
    display: inline-flex;
    width: max-content;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    max-width: 100%;
  }

  .tabs-segmented .tab {
    flex: 0 0 auto;
  }

  .module-page-shell-tabs {
    overflow: hidden;
  }
}

/* Phone toolbars, forms, modals, touch targets */
@media (max-width: 720px) {
  .toolbar.mediacao-toolbar,
  .module-page-shell-toolbar .mediacao-toolbar,
  .module-page-shell-toolbar .equipa-shell-toolbar {
    gap: 0.4rem;
  }

  .toolbar input {
    min-width: 0;
    flex: 1 1 140px;
  }

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

  .toolbar .btn {
    min-height: 40px;
    min-width: 40px;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .toolbar-icon-btn {
    min-width: 40px;
    min-height: 40px;
  }

  .form-row-2,
  .form-row-3,
  .negocio-modal-grid {
    grid-template-columns: 1fr !important;
  }

  .negocio-modal-overlay .negocio-modal,
  .confirm-dialog {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: 100dvh;
    border-radius: 12px;
  }

  .negocio-modal-footer,
  .confirm-dialog-actions {
    flex-direction: column;
  }

  .negocio-modal-footer .btn,
  .confirm-dialog-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .dashboard-widget-grid,
  .dashboard-widget-grid.dashboard-widget-grid-phone {
    display: flex !important;
    flex-direction: column;
    gap: var(--ds-card-gap);
    min-height: 0 !important;
    grid-auto-rows: auto !important;
    background-image: none;
  }

  .dashboard-widget-grid-phone.dashboard-widget-grid-editing .dashboard-widget-content {
    pointer-events: none;
  }

  .dashboard-widget-grid-phone.dashboard-widget-grid-editing {
    --dash-chrome-h: 2.75rem;
    padding-top: 2px;
    gap: var(--ds-card-gap);
  }

  .dashboard-widget-grid-phone .dashboard-widget-chrome {
    flex-wrap: wrap;
  }

  .dashboard-widget-grid-phone .dashboard-widget-move,
  .dashboard-widget-grid-phone .dashboard-widget-drag,
  .dashboard-widget-grid-phone .dashboard-widget-remove,
  .dashboard-widget-grid-phone .dashboard-widget-inspect-chrome {
    width: 2.25rem;
    height: 2.25rem;
  }

  .dashboard-widget-grid > .dashboard-widget,
  .dashboard-widget-grid > * {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100%;
    height: var(--dash-widget-h, auto);
    min-height: var(--dash-widget-h, var(--dash-widget-min-h, 144px));
    flex: 0 0 auto;
  }

  .dashboard-widget-grid-phone .dashboard-widget-content,
  .dashboard-widget-grid-phone .dashboard-widget-content > .kpi-card-v2,
  .dashboard-widget-grid-phone .dashboard-widget-content > .ds-card {
    height: 100%;
    min-height: 0;
  }

  .dashboard-widget-grid .dashboard-widget-content > .kpi-card-v2,
  .dashboard-widget-grid .dashboard-widget-content > .ds-card {
    min-height: var(--dash-widget-h, var(--dash-widget-min-h, 144px));
  }

  .dashboard-widget-grid-phone .dashboard-widget-resize {
    width: 28px;
    height: 28px;
    right: 8px;
    bottom: 8px;
  }

  .dashboard-widget-grid-phone .dashboard-widget-resize::after {
    inset: -10px;
  }

  .kpi-row-v2 {
    grid-template-columns: 1fr !important;
  }

  .equipa-location-rail {
    flex-wrap: nowrap;
  }

  .perfil-hero {
    padding: 1rem;
  }

  .topbar.topbar-dashboard.topbar-greeting {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "menu title photo bell"
      "year year novo novo";
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.55rem;
    padding: 0.7rem 1rem 0.75rem;
  }

  .topbar.topbar-dashboard.topbar-greeting .dashboard-greeting,
  .topbar.topbar-dashboard.topbar-greeting .topbar-title-row,
  .topbar.topbar-dashboard.topbar-greeting .dashboard-header-actions {
    display: contents;
  }

  .topbar.topbar-dashboard.topbar-greeting .nav-menu-btn {
    grid-area: menu;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .topbar.topbar-dashboard.topbar-greeting .page-title,
  .topbar.topbar-dashboard.topbar-greeting .dashboard-greeting h1 {
    grid-area: title;
    min-width: 0;
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar.topbar-dashboard.topbar-greeting .dashboard-greeting-sub,
  .topbar.topbar-dashboard.topbar-greeting .dashboard-date,
  .topbar.topbar-dashboard.topbar-greeting .dashboard-header-actions > .btn {
    display: none !important;
  }

  .topbar.topbar-dashboard.topbar-greeting .header-consultor-meter {
    display: flex;
    grid-area: photo;
    justify-self: end;
    align-items: center;
  }

  .topbar.topbar-dashboard.topbar-greeting .notif-bell-wrap {
    grid-area: bell;
    justify-self: end;
  }

  .topbar.topbar-dashboard.topbar-greeting .notif-bell-btn {
    width: 40px;
    height: 40px;
  }

  .topbar.topbar-dashboard.topbar-greeting .dashboard-period-filters {
    grid-area: year;
    justify-self: start;
    min-height: 40px;
    flex-wrap: wrap;
  }

  .topbar.topbar-dashboard.topbar-greeting .dashboard-year-filter {
    grid-area: auto;
    justify-self: start;
    min-height: 40px;
  }

  .topbar.topbar-dashboard.topbar-greeting .btn-primary-accent {
    grid-area: novo;
    justify-self: stretch;
    min-height: 40px;
    padding: 0.5rem 0.85rem;
    font-size: 0.8125rem;
    justify-content: center;
  }

  .avaliacao-card {
    padding: 1.15rem 1.15rem 1.05rem;
  }

  .avaliacao-card-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .avaliacao-card h3 {
    font-size: 1.2rem;
  }

  .avaliacao-card-sub {
    font-size: 0.8125rem;
  }

  .avaliacao-card-status {
    margin-top: 0.55rem;
    font-size: 0.75rem;
    padding: 0.28rem 0.65rem;
  }

  .avaliacao-card .btn-fill {
    margin-top: auto;
    min-height: 44px;
    padding: 0.7rem 1rem;
    font-size: 0.8125rem;
  }

  .data-list-card {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .faturacao-pedidos-col .data-list-cards,
  .matching-oportunidades-col .data-list-cards,
  .generic-list-embedded .data-list-cards,
  .module-page-table-cards .data-list-cards {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }
}

/* ── Equipa Recrutamento + CMI ── */
.equipa-list-view-toggle { margin-left: 0.35rem; }
.equipa-layout .module-page-shell-body:has(.recrutamento-panel),
.equipa-layout .module-page-shell-body:has(.equipa-cmi-panel) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.recrutamento-panel,
.equipa-cmi-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
}

.equipa-split-left.recrutamento-candidatos,
.equipa-split-right.recrutamento-calendario {
  min-height: 0;
  overflow: hidden;
}

.recrutamento-candidatos-table {
  flex: 1;
  min-height: 0;
}

.recrutamento-calendario .recrutamento-agenda-list,
.recrutamento-calendario .recrutamento-agenda-detail {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.equipa-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 1rem;
  min-height: 0;
  flex: 1;
}

.equipa-split.recrutamento-panel--no-calendario {
  grid-template-columns: minmax(0, 1fr);
}
.equipa-split-left,
.equipa-split-right,
.equipa-cmi-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.recrutamento-toolbar { flex-wrap: wrap; gap: 0.5rem; }
.recrutamento-fase-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.fase-agendar { background: #dbeafe; color: #1d4ed8; }
.fase-agendada { background: #fef3c7; color: #b45309; }
.fase-recrutado { background: #dcfce7; color: #15803d; }
.fase-rejeitado-habita { background: #fee2e2; color: #b91c1c; }
.fase-rejeitado-candidato { background: #ffedd5; color: #c2410c; }
.fase-default { background: #e5e7eb; color: #374151; }
.recrutamento-fase-radios { display: flex; flex-direction: column; gap: 0.65rem; }
.recrutamento-fase-radio { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.recrutamento-duration { display: flex; align-items: center; gap: 0.35rem; }
.recrutamento-duration input { width: 4.5rem; }
.recrutamento-entrevistadores {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.recrutamento-entrevistador-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.8125rem;
}
.recrutamento-entrevistador-item small { color: var(--muted, #6b7280); }
.recrutamento-tudo-toggle { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8125rem; }
.recrutamento-agenda-list { display: flex; flex-direction: column; gap: 0.4rem; }
.recrutamento-agenda-day {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--white, #fff);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  text-align: left;
}
.recrutamento-agenda-day.active { border-color: var(--primary-1, #1e3a8a); box-shadow: 0 0 0 1px var(--primary-1, #1e3a8a); }
.recrutamento-agenda-day-count {
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--primary-1, #1e3a8a);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.recrutamento-agenda-detail { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.65rem; }
.recrutamento-agenda-detail h4 { margin: 0; }
.recrutamento-agenda-card {
  display: grid;
  grid-template-columns: 5px 1fr;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.recrutamento-agenda-card-bar { background: #93c5fd; }
.recrutamento-agenda-card.sit-confirmada .recrutamento-agenda-card-bar { background: #34d399; }
.recrutamento-agenda-card.sit-realizada .recrutamento-agenda-card-bar { background: #22c55e; }
.recrutamento-agenda-card.sit-cancelada .recrutamento-agenda-card-bar { background: #f87171; }
.recrutamento-agenda-card.sit-reagendada .recrutamento-agenda-card-bar { background: #a78bfa; }
.recrutamento-agenda-card-body { padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.35rem; }
.recrutamento-agenda-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.equipa-cmi-panel { grid-template-columns: 220px minmax(0, 1fr); }
.equipa-cmi-tools {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.25rem;
}
.equipa-cmi-tool {
  text-align: left;
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}
.equipa-cmi-tool.active {
  border-color: var(--primary-1, #1e3a8a);
  background: linear-gradient(135deg, rgba(30,58,138,0.08), rgba(30,58,138,0.02));
  color: var(--primary-1, #1e3a8a);
}
.equipa-cmi-tool:disabled { opacity: 0.45; cursor: not-allowed; }
.cmi-html-preview {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
}
.equipa-colab-options { display: flex; flex-direction: column; gap: 0.55rem; }
.equipa-colab-option { width: 100%; justify-content: flex-start; }
.equipa-modal-wide { width: min(880px, 100%) !important; max-height: min(92vh, 860px); }

.equipa-colab-photo-field {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 4.5rem;
}

.equipa-colab-photo-preview {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--accent-muted);
  flex-shrink: 0;
}

.equipa-colab-photo-preview.is-perfil,
.equipa-colab-photo-placeholder.is-perfil {
  width: 56px;
  height: 84px;
}

.equipa-colab-photo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: var(--gray-100, #eef1f5);
  border: 1px dashed var(--gray-300, #cfd6df);
  flex-shrink: 0;
}

.equipa-colab-photo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}
.form-group-full { grid-column: 1 / -1; }
@media (max-width: 960px) {
  .equipa-split,
  .equipa-cmi-panel { grid-template-columns: 1fr; }
}

/* ── Tema Habita (admin debug catalog) ── */
.theme-debug-shell.module-page-shell {
  flex: 1;
  min-height: 0;
}

.theme-debug-shell > .module-page-shell-tabs {
  overflow-x: auto;
}

.theme-debug-shell .tabs-segmented {
  flex-wrap: wrap;
}

.theme-debug-shell > .module-page-shell-body {
  padding: 0;
  min-height: 0;
}

.theme-debug-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.theme-debug-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--ds-surface-muted, var(--gray-100));
  border: 1px solid var(--ds-border, var(--gray-200));
  border-radius: 999px;
  color: var(--gray-600);
  font-size: 0.8125rem;
  min-width: 200px;
  max-width: 360px;
  flex: 1 1 220px;
}

.theme-debug-search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--text);
}

.theme-debug-toolbar-meta {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--brand-navy);
  white-space: nowrap;
}

.theme-debug-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1.1rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.theme-debug-section {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.15rem 1.15rem;
}

.theme-debug-section-head {
  margin-bottom: 0.85rem;
}

.theme-debug-section-head h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--brand-navy);
}

.theme-debug-section-head p,
.theme-debug-list {
  margin: 0.35rem 0 0;
  color: var(--ds-text-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.theme-debug-list {
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.theme-debug-list code,
.theme-debug-token-meta code,
.theme-debug-icon-cell code,
.theme-debug-asset code,
.theme-debug-identity code {
  font-size: 0.75rem;
  color: var(--brand-navy);
}

.theme-debug-identity {
  max-width: 44rem;
}

.theme-debug-manual-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(45, 156, 72, 0.35);
}

.theme-debug-manual-link:hover,
.theme-debug-manual-link:focus-visible {
  color: var(--green-dark);
  border-bottom-color: var(--accent);
}

.theme-debug-token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
}

.theme-debug-token-grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.theme-debug-token {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  background: var(--ds-surface-muted);
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.theme-debug-token:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.theme-debug-swatch {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  border: 1px solid var(--ds-border);
  flex-shrink: 0;
  background-image:
    linear-gradient(45deg, #e2e6ee 25%, transparent 25%),
    linear-gradient(-45deg, #e2e6ee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e6ee 75%),
    linear-gradient(-45deg, transparent 75%, #e2e6ee 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}

.theme-debug-token-meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.theme-debug-token-meta span,
.theme-debug-token-meta small,
.theme-debug-asset small {
  color: var(--ds-text-muted);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-debug-type-samples {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  color: var(--text);
}

.theme-debug-type-huge {
  font-family: var(--font-heading);
  font-size: var(--font-size-huge);
  font-weight: 700;
  color: var(--brand-navy);
}

.theme-debug-type-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-title);
  font-weight: 700;
  color: var(--brand-navy);
}

.theme-debug-type-subtitle { font-size: var(--font-size-subtitle); }
.theme-debug-type-regular { font-size: var(--font-size-regular); color: var(--ds-text-muted); }
.theme-debug-type-tiny {
  font-size: var(--font-size-tiny);
  letter-spacing: 0.04em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ds-text-muted);
}

.theme-debug-shadow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.9rem;
}

.theme-debug-shadow-card {
  min-width: 140px;
  padding: 1.1rem 1.2rem;
  border-radius: var(--card-radius);
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  color: var(--brand-navy);
  font-size: 0.8125rem;
  font-weight: 650;
}

.theme-debug-shadow-card.is-shell {
  background: var(--primary-3);
  color: var(--white);
  border-color: transparent;
}

.theme-debug-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.55rem;
}

.theme-debug-icon-cell,
.theme-debug-asset {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  background: var(--ds-surface-muted);
  cursor: pointer;
  color: var(--brand-navy);
  font: inherit;
}

.theme-debug-icon-cell:hover,
.theme-debug-asset:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.theme-debug-icon-cell .ui-icon {
  color: var(--brand-navy);
}

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

.theme-debug-asset img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: var(--primary-1);
  border-radius: 8px;
  padding: 0.25rem;
}

.theme-debug-asset span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.theme-debug-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.theme-debug-inline-follow {
  margin-top: 0.85rem;
}

.theme-debug-combo-demo {
  max-width: 20rem;
}

.theme-debug-demo-card {
  flex: 1 1 260px;
  max-width: 360px;
  min-width: min(260px, 100%);
}

.theme-debug-cards-row .kpi-card-v2.theme-debug-demo-card {
  height: 168px;
  min-height: 168px;
}

.theme-debug-card-hint {
  padding: 0 var(--ds-content-pad) 1.1rem;
}

.theme-debug-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.theme-debug-form .form-group {
  margin-bottom: 0;
}

.status-aprovado {
  background: var(--tone-aprovado-bg);
  color: var(--tone-aprovado-fg);
}

.theme-debug-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.theme-debug-tabs-demo {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.theme-debug-tabs-demo .tabs {
  margin-bottom: 0;
}

.theme-debug-cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: stretch;
}

.theme-debug-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ds-text-muted, var(--gray-600));
}

.theme-debug-bars-gallery {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 42rem;
}

.theme-debug-bars {
  width: 100%;
  max-width: 42rem;
  flex: none;
  min-height: 0;
  gap: 0.7rem;
  padding: 0;
}

.theme-debug-bars .dash-bar-track,
.theme-debug-bars .dash-bar-pair .dash-bar-track {
  height: 10px;
}

.theme-debug-wallet-mix {
  max-width: 42rem;
  padding: 0;
}

.theme-debug-mix {
  max-width: 42rem;
}

.theme-debug-mix .mix-tile-track {
  height: 10px;
}

.theme-debug-perfil-progress {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 42rem;
}

.theme-debug-soi-bars {
  flex: none;
  min-height: 0;
  gap: 0.55rem;
  max-width: 42rem;
}

.theme-debug-soi-bars .soi-bar-track {
  height: 6px;
}

.theme-debug-bar {
  width: min(420px, 100%);
  height: 10px;
}

.theme-debug-table {
  max-width: 520px;
  min-width: 0;
}

.theme-debug-table tbody tr {
  cursor: default;
}

.theme-debug-grid-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: start;
}

.theme-debug-grid-row .theme-debug-table {
  flex: 1 1 28rem;
  max-width: 36rem;
}

.theme-debug-section .data-grid-col-menu.theme-debug-col-menu {
  position: relative;
  z-index: 1;
  top: auto;
  left: auto;
  max-height: none;
  overflow: visible;
}

@media (max-width: 960px) {
  .theme-debug-grid-row {
    grid-template-columns: 1fr;
  }
}

.theme-debug-inline-follow .error-msg {
  margin-top: 0.85rem;
}

.theme-debug-inline > .ui-tooltip-host,
.theme-debug-inline .notif-bell-wrap {
  width: auto;
  display: inline-flex;
}

.theme-debug-escalao-demo {
  position: relative;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
}

.theme-debug-escalao-demo .user-escalao-chip {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
}

.theme-debug-on-navy {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  background: var(--primary-1);
}

.theme-debug-on-navy .connection-badge {
  margin: 0;
}
