:root {
  --portal-bg: #f5f7fb;
  --portal-text: #1f2335;
  --portal-card-bg: #ffffff;
  --portal-border: rgba(31, 35, 53, 0.08);
  --portal-accent: #0063f7;
  --portal-accent-soft: rgba(0, 99, 247, 0.1);
  --portal-radius-md: 16px;
  --portal-radius-lg: 22px;
  --portal-shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.08);
  --portal-shadow-lg: 0 26px 70px rgba(15, 23, 42, 0.16);
  --portal-header-blur: blur(22px);
  --portal-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --portal-bg: #0e111a;
  --portal-text: #f5f7fb;
  --portal-card-bg: #161b2d;
  --portal-border: rgba(245, 247, 251, 0.08);
  --portal-accent: #00b4ff;
  --portal-accent-soft: rgba(0, 180, 255, 0.12);
  --portal-shadow-sm: 0 14px 32px rgba(0, 0, 0, 0.3);
  --portal-shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.48);
}

.portal-body {
  min-height: 100vh;
  background: var(--portal-bg);
  color: var(--portal-text);
  font-family: var(--portal-font-family);
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--portal-mobile-nav-height, 0px));
}

[data-theme="dark"] .portal-body {
  background: radial-gradient(circle at 50% 0%, #161e38 0%, #0e111a 75%);
}

.portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: color-mix(in srgb, var(--portal-card-bg) 88%, transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: var(--portal-header-blur);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.07);
}

.portal-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-header__inline {
  color: rgba(31, 35, 53, 0.6);
}

[data-theme="dark"] .portal-header__inline {
  color: rgba(245, 247, 251, 0.65);
}

.portal-brand strong {
  font-size: 1rem;
}

.portal-brand small {
  font-size: 0.75rem;
}

.portal-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--portal-accent), rgba(0, 0, 0, 0.35));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 20px rgba(0, 0, 0, 0.1);
}

.portal-logo img {
  display: block;
  max-width: 30px;
  max-height: 30px;
  width: auto;
  height: auto;
}

[data-theme="dark"] .portal-logo img {
  filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.15));
}

.portal-nav {
  position: sticky;
  top: 72px;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: color-mix(in srgb, var(--portal-card-bg) 92%, transparent);
  border-bottom: 1px solid var(--portal-border);
  backdrop-filter: blur(18px);
}

.portal-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  color: var(--portal-text);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.portal-nav__link:hover {
  background: var(--portal-accent-soft);
  color: var(--portal-accent);
}

.portal-nav__link.is-active {
  background: var(--portal-accent-soft);
  color: var(--portal-accent);
  font-weight: 600;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.portal-nav-mobile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: 0.5rem clamp(1rem, 4vw, 2rem);
  padding-bottom: calc(env(safe-area-inset-bottom) + 0.75rem);
  background: color-mix(in srgb, var(--portal-card-bg) 95%, transparent);
  border-top: 1px solid var(--portal-border);
  backdrop-filter: blur(24px);
  box-shadow: 0 -20px 40px rgba(15, 23, 42, 0.14);
  z-index: 1040;
}

.portal-nav-mobile__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  text-decoration: none;
  color: rgba(31, 35, 53, 0.65);
  background: transparent;
  border: none;
}

.portal-nav-mobile__item i {
  font-size: 1.2rem;
}

.portal-nav-mobile__item.is-active {
  color: var(--portal-accent);
}

.portal-main {
  flex: 1 1 auto;
  padding: 2.5rem clamp(1.25rem, 5vw, 2.5rem) 3.5rem;
}

.portal-footer {
  border-top: 1px solid var(--portal-border);
  background: rgba(0, 0, 0, 0.02);
}

.portal-login-container {
  padding-top: 4rem;
}

.portal-card {
  background: var(--portal-card-bg);
  border-radius: var(--portal-radius-lg);
  border: 1px solid var(--portal-border);
  box-shadow: var(--portal-shadow-sm);
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.portal-stat {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 140px;
  box-shadow: var(--portal-shadow-sm);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.portal-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--portal-shadow-lg);
  border-color: rgba(0, 99, 247, 0.2);
}

[data-theme="dark"] .portal-stat:hover {
  border-color: rgba(0, 180, 255, 0.25);
}

.portal-stat:nth-child(1) { border-left: 4px solid #3b82f6; }
.portal-stat:nth-child(2) { border-left: 4px solid #10b981; }
.portal-stat:nth-child(3) { border-left: 4px solid #8b5cf6; }

.portal-stat__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(31, 35, 53, 0.6);
}

[data-theme="dark"] .portal-stat__label {
  color: rgba(245, 247, 251, 0.6);
}

.portal-stat__value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--portal-text);
  font-variant-numeric: tabular-nums;
}

.portal-stat__value--muted {
  color: rgba(31, 35, 53, 0.65);
}

[data-theme="dark"] .portal-stat__value--muted {
  color: rgba(245, 247, 251, 0.65);
}

.portal-highlight {
  background: var(--portal-accent-soft);
  border-radius: var(--portal-radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-highlight__label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.portal-highlight__value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--portal-text);
  font-variant-numeric: tabular-nums;
}

.portal-highlight--empty {
  flex-direction: row;
  align-items: center;
  gap: 1.25rem;
}

.portal-highlight--empty i {
  font-size: 2rem;
  color: rgba(31, 35, 53, 0.35);
}

[data-theme="dark"] .portal-highlight--empty i {
  color: rgba(245, 247, 251, 0.35);
}

.portal-invoice-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(31, 35, 53, 0.08);
}

.portal-invoice-list__item:last-child {
  border-bottom: none;
}

[data-theme="dark"] .portal-invoice-list__item {
  border-bottom-color: rgba(245, 247, 251, 0.08);
}

.portal-diagnostics__item {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  color: rgba(31, 35, 53, 0.75);
}

[data-theme="dark"] .portal-diagnostics__item {
  color: rgba(245, 247, 251, 0.75);
}

.portal-diagnostics__item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--portal-accent);
  position: absolute;
  left: 0;
  top: 0.45rem;
}

.portal-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-quick-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--portal-border);
  border-radius: var(--portal-radius-md);
  background: transparent;
  color: var(--portal-text);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.portal-quick-action i {
  font-size: 1.5rem;
  color: var(--portal-accent);
}

.portal-quick-action strong {
  display: block;
  font-size: 1rem;
}

.portal-quick-action small {
  color: rgba(31, 35, 53, 0.6);
}

[data-theme="dark"] .portal-quick-action small {
  color: rgba(245, 247, 251, 0.6);
}

.portal-quick-action:hover {
  border-style: solid;
  border-color: var(--portal-accent);
  background: var(--portal-accent-soft);
  transform: translateY(-1px);
}

.portal-quick-action:disabled,
.portal-quick-action[disabled] {
  cursor: not-allowed;
  opacity: 0.85;
}

.portal-announcements {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-announcement {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--portal-radius-md);
  border: 1px solid var(--portal-border);
  background: rgba(0, 0, 0, 0.015);
  box-shadow: var(--portal-shadow-sm);
}

[data-theme="dark"] .portal-announcement {
  background: rgba(255, 255, 255, 0.03);
}

.portal-announcement__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.3rem;
}

.portal-announcement__title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.portal-panel {
  background: var(--portal-card-bg);
  border-radius: var(--portal-radius-lg);
  border: 1px solid var(--portal-border);
  padding: 1.5rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--portal-shadow-sm);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.portal-panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--portal-shadow-lg);
  border-color: rgba(0, 99, 247, 0.15);
}

[data-theme="dark"] .portal-panel:hover {
  border-color: rgba(0, 180, 255, 0.2);
}

.portal-table table {
  background: var(--portal-card-bg);
  border-radius: var(--portal-radius-lg);
  overflow: hidden;
}

.portal-table thead {
  background: rgba(0, 0, 0, 0.02);
}

.portal-empty {
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed var(--portal-border);
  border-radius: 24px;
}

.portal-panel__header {
  margin-bottom: 1rem;
}

.portal-panel__body {
  flex: 1 1 auto;
}

.portal-placeholder {
  background: var(--portal-accent-soft);
  border-radius: var(--portal-radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--portal-accent);
  font-weight: 600;
}

.portal-placeholder i {
  font-size: 1.5rem;
}

.skeleton {
  position: relative;
  color: transparent !important;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.05));
  background-size: 200% 100%;
  animation: portal-skeleton-shimmer 1.2s linear infinite;
  border-radius: 6px;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
}

.skeleton::selection {
  background: transparent;
}

.skeleton--text {
  min-height: 1em;
  display: inline-flex;
  align-items: center;
}

@keyframes portal-skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.portal-checklist {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.portal-checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
}

.portal-checklist li::before {
  position: absolute;
  left: 0;
  top: 0.2rem;
  font-family: "bootstrap-icons";
}

.portal-checklist li.done::before {
  content: "\f26e";
  color: var(--portal-accent);
}

.portal-checklist li.pending::before {
  content: "\f287";
  color: rgba(31, 35, 53, 0.5);
}

.portal-pix__status {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.portal-pix__status strong {
  font-variant-numeric: tabular-nums;
}

.portal-pix__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.portal-pix__qr img {
  max-width: 220px;
  box-shadow: var(--portal-shadow-sm);
}

.portal-usage-chart {
  position: relative;
  width: 100%;
  min-height: 200px;
}

.portal-usage-chart canvas {
  width: 100%;
  height: 200px;
  display: block;
}

.portal-usage-summary {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.portal-usage-summary div {
  min-width: 140px;
}

.portal-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(31, 35, 53, 0.08);
  font-size: 0.87rem;
  font-weight: 600;
}

[data-theme="dark"] .portal-status-chip {
  background: rgba(245, 247, 251, 0.08);
}

.portal-status-chip__indicator {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
  background: rgba(31, 35, 53, 0.35);
  box-shadow: 0 0 0 4px rgba(31, 35, 53, 0.08);
}

[data-theme="dark"] .portal-status-chip__indicator {
  background: rgba(245, 247, 251, 0.45);
  box-shadow: 0 0 0 4px rgba(245, 247, 251, 0.08);
}

@keyframes portal-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.portal-status-chip__indicator[data-status="success"] {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.24);
  animation: portal-pulse 2s infinite;
}

.portal-status-chip__indicator[data-status="warning"] {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.portal-status-chip__indicator[data-status="danger"] {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

.portal-status-chip__indicator[data-status="offline"] {
  background: rgba(31, 35, 53, 0.45);
}

.portal-status-chip--success {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.portal-status-chip--warning {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.portal-status-chip--danger {
  background: rgba(239, 68, 68, 0.12);
  color: #7f1d1d;
}

[data-theme="dark"] .portal-status-chip--success {
  color: #bbf7d0;
}

[data-theme="dark"] .portal-status-chip--warning {
  color: #fde68a;
}

[data-theme="dark"] .portal-status-chip--danger {
  color: #fecaca;
}

.portal-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-timeline__item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px dashed var(--portal-border);
}

.portal-timeline__item:last-child {
  border-bottom: none;
}

.portal-timeline__indicator {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--portal-accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--portal-accent);
}

.portal-timeline__item--success .portal-timeline__indicator {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.portal-timeline__item--danger .portal-timeline__indicator {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.portal-timeline__item--warning .portal-timeline__indicator {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.portal-timeline__item--primary .portal-timeline__indicator {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.portal-filters {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr auto;
  align-items: end;
  background: var(--portal-card-bg);
  border-radius: var(--portal-radius-md);
  border: 1px solid var(--portal-border);
  padding: 1rem;
  box-shadow: var(--portal-shadow-sm);
}

.portal-filters__group {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.portal-filters__search .input-group-text {
  background: transparent;
  border-right: none;
}

.portal-filters__search .form-control {
  border-left: none;
  padding-left: 0.25rem;
}

.portal-invoice-group {
  margin-bottom: 2rem;
}

.portal-invoice-group:last-of-type {
  margin-bottom: 0;
}

.portal-invoice-group .portal-table table {
  table-layout: fixed;
  width: 100%;
  min-width: 920px;
}

.portal-invoice-group .portal-table th:nth-child(1),
.portal-invoice-group .portal-table td:nth-child(1) {
  width: 34%;
}

.portal-invoice-group .portal-table th:nth-child(2),
.portal-invoice-group .portal-table td:nth-child(2) {
  width: 14%;
}

.portal-invoice-group .portal-table th:nth-child(3),
.portal-invoice-group .portal-table td:nth-child(3) {
  width: 16%;
}

.portal-invoice-group .portal-table th:nth-child(4),
.portal-invoice-group .portal-table td:nth-child(4) {
  width: 14%;
}

.portal-invoice-group .portal-table th:nth-child(5),
.portal-invoice-group .portal-table td:nth-child(5) {
  width: 22%;
}

.portal-invoice-group .portal-table td:first-child {
  overflow: hidden;
}

.portal-invoice-group .portal-table td:first-child .text-muted {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-invoice-row--match {
  background: rgba(0, 99, 247, 0.05);
}

[data-theme="dark"] .portal-invoice-row--match {
  background: rgba(0, 180, 255, 0.1);
}

.portal-invoice-row--dim {
  opacity: 0.6;
}

.portal-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.portal-theme-toggle i {
  font-size: 1rem;
}

.portal-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--portal-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.portal-avatar__label {
  font-weight: 600;
  margin-left: 0.5rem;
}

.portal-user-menu .dropdown-menu {
  border-radius: var(--portal-radius-md);
  border: 1px solid var(--portal-border);
  box-shadow: var(--portal-shadow-lg);
}

.portal-notify {
  position: relative;
}

.portal-notify__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  border-radius: 999px;
  background: var(--portal-accent);
  color: #fff;
  box-shadow: 0 0 0 2px var(--portal-card-bg);
}

.portal-toast {
  box-shadow: var(--portal-shadow-lg);
}

@media (max-width: 1024px) {
  .portal-nav {
    top: 66px;
  }
}

@media (max-width: 768px) {
  .portal-main {
    padding: 1.5rem 1rem 2.5rem;
  }

  .portal-nav {
    flex-wrap: wrap;
    gap: 0.25rem;
    top: 60px;
  }

  .portal-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .portal-quick-action {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

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

  .portal-announcement__icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .portal-nav-mobile {
    display: flex;
  }

  .portal-header__inline {
    display: none !important;
  }

  .portal-filters {
    grid-template-columns: 1fr;
  }
}

@keyframes portal-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-stat,
.portal-panel {
  animation: portal-fade-in-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.portal-stat:nth-child(1) { animation-delay: 0.05s; }
.portal-stat:nth-child(2) { animation-delay: 0.1s; }
.portal-stat:nth-child(3) { animation-delay: 0.15s; }

.portal-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(31, 35, 53, 0.45);
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="dark"] .portal-section-title {
  color: rgba(245, 247, 251, 0.45);
}

/* Cards de resumo de faturas */
.portal-invoice-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.portal-summary-card {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  min-height: 120px;
  box-shadow: var(--portal-shadow-sm);
}

.portal-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--portal-shadow-lg);
}

.portal-summary-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--portal-accent-soft);
  color: var(--portal-accent);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.portal-summary-card__content {
  flex: 1;
  min-width: 0;
}

.portal-summary-card__label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(31, 35, 53, 0.6);
  margin-bottom: 0.35rem;
}

[data-theme="dark"] .portal-summary-card__label {
  color: rgba(245, 247, 251, 0.6);
}

.portal-summary-card__value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--portal-text);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.portal-summary-card__meta {
  font-size: 0.8rem;
  color: rgba(31, 35, 53, 0.65);
}

[data-theme="dark"] .portal-summary-card__meta {
  color: rgba(245, 247, 251, 0.65);
}

.portal-summary-card--danger {
  border-left: 4px solid #dc2626;
}

.portal-summary-card--danger .portal-summary-card__icon {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.portal-summary-card--danger .portal-summary-card__value {
  color: #dc2626;
}

.portal-summary-card--success {
  border-left: 4px solid #16a34a;
}

.portal-summary-card--success .portal-summary-card__icon {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.portal-summary-card--warning {
  border-left: 4px solid #f59e0b;
}

.portal-summary-card--warning .portal-summary-card__icon {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.portal-summary-card--warning .portal-summary-card__value {
  color: #d97706;
}

.portal-summary-card--info {
  border-left: 4px solid #3b82f6;
}

.portal-summary-card--info .portal-summary-card__icon {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

/* Banner de alerta */
.portal-alert {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--portal-radius-md);
  border: 1px solid;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--portal-shadow-sm);
}

.portal-alert--danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

[data-theme="dark"] .portal-alert--danger {
  border-color: rgba(254, 202, 202, 0.2);
  background: rgba(254, 202, 202, 0.1);
  color: #fca5a5;
}

.portal-alert__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.portal-alert--danger .portal-alert__icon {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
}

.portal-alert__content {
  flex: 1;
  min-width: 0;
}

.portal-alert__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.portal-alert__message {
  font-size: 0.9rem;
  opacity: 0.9;
}

.portal-alert__actions {
  flex-shrink: 0;
}

/* Bullets de status */
.portal-status-bullet {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.portal-status-bullet__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.portal-status-bullet--primary .portal-status-bullet__dot {
  background: #3b82f6;
}

.portal-status-bullet--primary {
  color: #3b82f6;
}

.portal-status-bullet--danger .portal-status-bullet__dot {
  background: #dc2626;
}

.portal-status-bullet--danger {
  color: #dc2626;
}

.portal-status-bullet--success .portal-status-bullet__dot {
  background: #16a34a;
}

.portal-status-bullet--success {
  color: #16a34a;
}

.portal-status-bullet--secondary .portal-status-bullet__dot {
  background: #64748b;
}

.portal-status-bullet--secondary {
  color: #64748b;
}

/* Ajustes na navegação para o botão de atendimento */
.portal-nav__link[data-open-support] {
  background: transparent;
  border: none;
  cursor: pointer;
}

/* Dashboard CTA */
.portal-dashboard-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--portal-radius-md);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .portal-dashboard-cta {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.12));
  border-color: rgba(59, 130, 246, 0.3);
}

.portal-dashboard-cta__content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.portal-dashboard-cta__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.portal-dashboard-cta__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--portal-text);
  margin-bottom: 0.15rem;
}

.portal-dashboard-cta__subtitle {
  font-size: 0.85rem;
  color: rgba(31, 35, 53, 0.7);
}

[data-theme="dark"] .portal-dashboard-cta__subtitle {
  color: rgba(245, 247, 251, 0.7);
}

@media (max-width: 768px) {
  .portal-invoice-summary-cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .portal-summary-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-summary-card__icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .portal-summary-card__value {
    font-size: 1.3rem;
  }

  .portal-alert {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .portal-alert__actions {
    width: 100%;
  }

  .portal-alert__actions .btn {
    width: 100%;
  }

  .portal-dashboard-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-dashboard-cta__content {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-dashboard-cta .btn {
    width: 100%;
  }
}

/* Core dark theme: matches the dashboard preview color direction. */
[data-theme="dark"] {
  --portal-bg: #080808;
  --portal-text: #f8f9fa;
  --portal-card-bg: rgba(18, 18, 18, 0.7);
  --portal-border: rgba(255, 193, 7, 0.1);
  --portal-accent: #ffc107 !important;
  --portal-accent-soft: rgba(255, 193, 7, 0.15) !important;
  --portal-shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.3);
  --portal-shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.42);
}

[data-theme="dark"] .portal-body {
  background:
    radial-gradient(circle at 10% 20%, rgba(220, 53, 69, 0.08) 0%, rgba(0, 0, 0, 1) 90%),
    radial-gradient(circle at 90% 80%, rgba(255, 193, 7, 0.08) 0%, rgba(0, 0, 0, 1) 90%),
    #080808;
  color: #f8f9fa;
}

[data-theme="dark"] .portal-header {
  background-color: rgba(18, 18, 18, 0.9);
  border-bottom-color: rgba(255, 193, 7, 0.15);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .portal-nav,
[data-theme="dark"] .portal-nav-mobile {
  background-color: rgba(15, 15, 15, 0.8);
  border-color: rgba(255, 193, 7, 0.1);
}

[data-theme="dark"] .portal-nav__link,
[data-theme="dark"] .portal-nav-mobile__item {
  color: rgba(248, 249, 250, 0.78);
}

[data-theme="dark"] .portal-nav__link:hover,
[data-theme="dark"] .portal-nav__link.is-active,
[data-theme="dark"] .portal-nav-mobile__item.is-active {
  color: #ffc107;
  background: rgba(255, 193, 7, 0.1);
}

[data-theme="dark"] .portal-panel,
[data-theme="dark"] .portal-stat,
[data-theme="dark"] .portal-summary-card,
[data-theme="dark"] .portal-card,
[data-theme="dark"] .portal-table table {
  background: rgba(18, 18, 18, 0.7);
  border-color: rgba(255, 193, 7, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .portal-panel:hover,
[data-theme="dark"] .portal-stat:hover,
[data-theme="dark"] .portal-summary-card:hover {
  border-color: rgba(255, 193, 7, 0.22);
}

[data-theme="dark"] .portal-panel__header {
  border-bottom: 1px solid rgba(255, 193, 7, 0.1);
}

[data-theme="dark"] .portal-dashboard-cta,
[data-theme="dark"] .portal-highlight {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.15), rgba(255, 193, 7, 0.05));
  border-color: rgba(255, 193, 7, 0.2);
}

[data-theme="dark"] .portal-dashboard-cta__icon,
[data-theme="dark"] .portal-summary-card__icon {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] .portal-summary-card__label,
[data-theme="dark"] .portal-summary-card__meta,
[data-theme="dark"] .portal-dashboard-cta__subtitle {
  color: #b0b0b0 !important;
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(45deg, #dc3545 0%, #ffc107 100%);
  border-color: transparent;
  color: #000;
  font-weight: 600;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus {
  color: #000;
  box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-outline-light,
[data-theme="dark"] .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.2);
  color: #f8f9fa;
}

[data-theme="dark"] .btn-outline-light:hover,
[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #f8f9fa;
  color: #f8f9fa;
}

[data-theme="dark"] .portal-footer {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 193, 7, 0.1);
}

[data-theme="dark"] .portal-panel .table,
[data-theme="dark"] .portal-table .table {
  --bs-table-bg: transparent;
  --bs-table-color: #f8f9fa;
  --bs-table-border-color: rgba(255, 193, 7, 0.12);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-striped-color: #f8f9fa;
  --bs-table-hover-bg: rgba(255, 193, 7, 0.07);
  --bs-table-hover-color: #ffffff;
  color: #f8f9fa;
  background-color: transparent;
}

[data-theme="dark"] .portal-panel .table thead,
[data-theme="dark"] .portal-panel .table tbody,
[data-theme="dark"] .portal-panel .table tr,
[data-theme="dark"] .portal-panel .table th,
[data-theme="dark"] .portal-panel .table td,
[data-theme="dark"] .portal-table .table thead,
[data-theme="dark"] .portal-table .table tbody,
[data-theme="dark"] .portal-table .table tr,
[data-theme="dark"] .portal-table .table th,
[data-theme="dark"] .portal-table .table td {
  background-color: transparent;
  border-color: rgba(255, 193, 7, 0.12);
  color: inherit;
}

[data-theme="dark"] .portal-panel .table thead th,
[data-theme="dark"] .portal-table .table thead th {
  color: #ffc107 !important;
  background: rgba(255, 193, 7, 0.06);
}

[data-theme="dark"] .portal-panel .table tbody tr:hover > *,
[data-theme="dark"] .portal-table .table tbody tr:hover > * {
  background: rgba(255, 193, 7, 0.07);
  color: #ffffff;
}

[data-theme="dark"] .portal-panel .table a,
[data-theme="dark"] .portal-table .table a {
  color: #ffc107;
}

[data-theme="dark"] .portal-panel .table a:hover,
[data-theme="dark"] .portal-table .table a:hover {
  color: #ffda6a;
}

[data-theme="dark"] .portal-panel .table .fw-medium,
[data-theme="dark"] .portal-panel .table .fw-bold,
[data-theme="dark"] .portal-panel .table .fw-semibold,
[data-theme="dark"] .portal-table .table .fw-medium,
[data-theme="dark"] .portal-table .table .fw-bold,
[data-theme="dark"] .portal-table .table .fw-semibold {
  color: #f8f9fa;
}

[data-theme="dark"] .portal-invoice-group header h2,
[data-theme="dark"] .portal-invoice-group header span {
  color: #f8f9fa;
}

[data-theme="dark"] .portal-filters,
[data-theme="dark"] .portal-empty {
  background: rgba(18, 18, 18, 0.7);
  border-color: rgba(255, 193, 7, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .form-label,
[data-theme="dark"] .form-text,
[data-theme="dark"] dt,
[data-theme="dark"] dd {
  color: #f8f9fa;
}

[data-theme="dark"] .form-text {
  opacity: 0.75;
}

[data-theme="dark"] .invalid-feedback {
  color: #ff8b98;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea.form-control,
[data-theme="dark"] .input-group-text {
  background-color: #1a1a1a;
  border-color: rgba(255, 193, 7, 0.18);
  color: #f8f9fa;
}

[data-theme="dark"] .form-control::placeholder {
  color: rgba(248, 249, 250, 0.42);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] textarea.form-control:focus {
  background-color: #1a1a1a;
  border-color: rgba(255, 193, 7, 0.55);
  color: #ffffff;
  box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.14);
}

[data-theme="dark"] .form-control:read-only,
[data-theme="dark"] textarea.form-control:read-only {
  background-color: rgba(26, 26, 26, 0.82);
}

[data-theme="dark"] .portal-user-menu .dropdown-menu,
[data-theme="dark"] .dropdown-menu {
  background: #121212;
  border-color: rgba(255, 193, 7, 0.18);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .dropdown-header,
[data-theme="dark"] .dropdown-item {
  color: #f8f9fa;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

[data-theme="dark"] .dropdown-divider {
  border-top-color: rgba(255, 193, 7, 0.14);
}

[data-theme="dark"] .modal-content {
  background-color: #121212;
  color: #f8f9fa;
  border: 1px solid rgba(255, 193, 7, 0.2);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  border-color: rgba(255, 193, 7, 0.12);
}

[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%);
}

[data-theme="dark"] .alert {
  background-color: rgba(18, 18, 18, 0.82);
  border-color: rgba(255, 193, 7, 0.16);
  color: #f8f9fa;
}

[data-theme="dark"] .alert-danger {
  background-color: rgba(220, 53, 69, 0.14);
  border-color: rgba(220, 53, 69, 0.32);
  color: #f8d7da;
}

[data-theme="dark"] .alert-info {
  background-color: rgba(255, 193, 7, 0.12);
  border-color: rgba(255, 193, 7, 0.28);
  color: #ffe8a1;
}

[data-theme="dark"] .alert-success {
  background-color: rgba(25, 135, 84, 0.14);
  border-color: rgba(25, 135, 84, 0.32);
  color: #b7f3d0;
}

[data-theme="dark"] .bg-primary-subtle,
[data-theme="dark"] .bg-success-subtle,
[data-theme="dark"] .bg-danger-subtle,
[data-theme="dark"] .bg-secondary {
  border: 1px solid currentColor;
}

[data-theme="dark"] .bg-primary-subtle {
  background-color: rgba(255, 193, 7, 0.14) !important;
}

[data-theme="dark"] .bg-success-subtle {
  background-color: rgba(25, 135, 84, 0.16) !important;
}

[data-theme="dark"] .bg-danger-subtle {
  background-color: rgba(220, 53, 69, 0.16) !important;
}

[data-theme="dark"] .text-primary {
  color: #ffc107 !important;
}

[data-theme="dark"] .text-success {
  color: #7ee2a8 !important;
}

[data-theme="dark"] .text-danger {
  color: #ff8b98 !important;
}

[data-theme="dark"] .border,
[data-theme="dark"] .rounded.border {
  border-color: rgba(255, 193, 7, 0.18) !important;
}

[data-theme="dark"] .portal-pix__qr img {
  background: #ffffff;
  padding: 0.5rem;
}
