/* ==========================================================================
   BADGES, TABELAS FINANCEIRAS E CONTROLES DE APOIO
   ========================================================================== */

.table-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.table-badge-neutral {
  background: #e2e8f0;
  color: #334155;
}

.table-badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.table-badge-green {
  background: #dcfce7;
  color: #166534;
}

.table-badge-violet {
  background: #ede9fe;
  color: #6d28d9;
}

.table-badge-amber {
  background: #fef3c7;
  color: #b45309;
}

.table-badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.table-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #64748b;
}

.table-col-description {
  min-width: 260px;
}

.table-col-category {
  min-width: 160px;
}

.table-cell-description {
  min-width: 260px;
  max-width: 420px;
}

.launch-table {
  min-width: 620px;
}

.launch-table .table-col-category {
  min-width: 92px;
}

.launch-table .table-col-description,
.launch-table .table-cell-description {
  min-width: 150px;
  max-width: 200px;
  white-space: normal;
}

.launch-table .table-cell-description .table-muted {
  display: block;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}

.launch-table .table-stack-compact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.launch-row-parcelado td {
  background: linear-gradient(
    180deg,
    rgba(255, 247, 237, 0.82) 0%,
    rgba(255, 251, 235, 0.94) 100%
  );
}

.table-vencimento-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.table-vencimento-copy strong {
  color: #0f172a;
}

.table-vencimento-copy span {
  font-size: 0.78rem;
  font-weight: 700;
  color: #b45309;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-vencimento-copy.is-empty strong {
  color: #64748b;
}

.launch-table .table-actions-launch {
  min-width: 110px;
  gap: 0.3rem;
}

.launch-table .table-btn {
  font-size: 0.78rem;
  padding: 0.46rem 0.52rem;
}

.launch-table thead th,
.launch-table tbody td {
  padding-inline: 0.55rem;
}

.table-cell-highlight {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.table-row-entry-highlight td {
  background: linear-gradient(
    180deg,
    rgba(220, 252, 231, 0.72) 0%,
    rgba(240, 253, 244, 0.92) 100%
  ) !important;
}

.table-row-exit-highlight td {
  background: linear-gradient(
    180deg,
    rgba(254, 226, 226, 0.72) 0%,
    rgba(255, 241, 242, 0.92) 100%
  ) !important;
}

/* Badges compactos nas tabelas financeiras */
.launch-table .table-badge {
  min-height: 20px;
  padding: 0.18rem 0.52rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

/* Filtro de data (mês/ano) na tabela de lançamentos */
.list-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.62rem;
  margin-bottom: 0.5rem;
}


.launch-date-filter {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0.28rem;
  border-radius: 999px;
  background: #eaf2ff;
  border: 1px solid rgba(37, 99, 235, 0.14);
  flex-wrap: nowrap;
}

.launch-filter-select {
  height: 38px;
  padding: 0.2rem 0.55rem;
  border: 0;
  background: transparent;
  color: #385074;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
  appearance: auto;
  outline: none;
  min-width: 58px;
}

.launch-filter-select + .launch-filter-select {
  border-left: 1px solid rgba(37, 99, 235, 0.14);
  padding-left: 0.55rem;
}

.launch-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  width: 38px;
  border: 0;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
  margin-left: 0.22rem;
}

.launch-filter-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.launch-filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  width: 38px;
  border-radius: 999px;
  color: #b91c1c;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  margin-left: 0.1rem;
}

.launch-filter-clear:hover {
  color: #7f1d1d;
  background: rgba(185, 28, 28, 0.08);
}


/* Forçar quebra de linha na coluna de descrição */
.launch-col-description .table-muted,
.launch-table .table-cell-description .table-muted {
  display: block;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  max-width: 240px;
}

@media (max-width: 767.98px) {
  .list-filters-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.48rem;
  }

  .launch-date-filter {
    width: 100%;
  }

  .launch-filter-select {
    flex: 1;
    min-width: 0;
  }
}

.table-row-balance-highlight td {
  background: linear-gradient(
    180deg,
    rgba(219, 234, 254, 0.78) 0%,
    rgba(239, 246, 255, 0.94) 100%
  ) !important;
}

.table-cell-finance {
  min-width: 138px;
}

.table-cell-month {
  min-width: 132px;
}

.table-cell-wrap {
  white-space: normal !important;
}

.table-cell-total {
  font-weight: 800;
  font-size: 1rem;
}

.table-mode-switch {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.32rem;
  border-radius: 999px;
  background: #eaf2ff;
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.table-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #385074;
  font-size: 0.86rem;
  font-weight: 900;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.table-mode-btn:hover {
  background: rgba(255, 255, 255, 0.75);
  color: #1d4ed8;
  transform: translateY(-1px);
}

.table-mode-btn.is-active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

@media (max-width: 767.98px) {
  .table-mode-switch {
    display: flex;
    width: 100%;
  }

  .table-mode-btn {
    flex: 1 1 0;
    text-align: center;
  }
}

.modern-checkbox-green input:checked + span {
  background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
  border-color: rgba(21, 128, 61, 0.45);
  color: #fff;
  box-shadow: 0 18px 35px rgba(21, 128, 61, 0.18);
}

.modern-checkbox-green span {
  border-color: rgba(21, 128, 61, 0.28);
  color: #166534;
}

.modern-checkbox-green:hover span {
  border-color: rgba(21, 128, 61, 0.45);
  box-shadow: 0 12px 25px rgba(21, 128, 61, 0.1);
}

.modern-checkbox-blue input:checked + span {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  border-color: rgba(37, 99, 235, 0.5);
  color: #fff;
  box-shadow: 0 18px 35px rgba(37, 99, 235, 0.18);
}

.modern-checkbox-blue span {
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
}

.modern-checkbox-blue:hover span {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.1);
}

.modern-checkbox-violet input:checked + span {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
  border-color: rgba(109, 40, 217, 0.45);
  color: #fff;
  box-shadow: 0 18px 35px rgba(109, 40, 217, 0.18);
}

.modern-checkbox-violet span {
  border-color: rgba(109, 40, 217, 0.28);
  color: #6d28d9;
}

.table-section-title {
  margin-bottom: 0.8rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.app-nav .nav-link {
  color: #334155;
  font-weight: 700;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus,
.app-nav .nav-link.show {
  color: #0f172a;
}

.app-nav .dropdown-menu {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.app-nav .dropdown-item {
  border-radius: 12px;
  padding: 0.72rem 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.app-nav .dropdown-item:hover,
.app-nav .dropdown-item:focus {
  background: #eef4ff;
  color: #1d4ed8;
}

.app-nav .btn-outline-light {
  border-width: 1px;
  border-color: rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
  background: #eff6ff;
}

.app-nav .btn-danger {
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.18);
}

.app-nav .nav-alert-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: #fff7ed;
  color: #b45309;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.app-nav .nav-alert-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.12);
}

.app-nav .nav-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
}

.view-page-body {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at top left,
      rgba(37, 99, 235, 0.12),
      transparent 26%
    ),
    radial-gradient(
      circle at top right,
      rgba(148, 163, 184, 0.18),
      transparent 24%
    ),
    linear-gradient(180deg, #f7f9fd 0%, #eef3fb 100%);
}

.view-shell {
  width: min(1080px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding-bottom: 2.5rem;
}

.view-stage {
  display: grid;
  gap: 1.2rem;
}

.view-panel {
  padding: 1.35rem;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.view-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.view-panel-header h2 {
  margin: 0.45rem 0 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
}

.view-panel-header p {
  margin: 0.35rem 0 0;
  color: #64748b;
  line-height: 1.55;
}

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

.view-card {
  padding: 1rem 1.05rem;
  border-radius: 22px;
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.98) 0%,
    rgba(241, 245, 249, 0.95) 100%
  );
  border: 1px solid rgba(148, 163, 184, 0.16);
}

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

.view-card strong {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.view-card span {
  margin-top: 0.42rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.45;
  word-break: break-word;
}

.view-card.is-wide {
  grid-column: 1 / -1;
}

.view-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.1rem;
}

.view-actions-copy {
  color: #64748b;
  line-height: 1.55;
}

.view-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.view-panel .btn-modern-secondary {
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #334155;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  box-shadow: 0 10px 20px rgba(148, 163, 184, 0.18);
}

.view-panel .btn-modern-secondary:hover {
  background: linear-gradient(180deg, #ffffff 0%, #e5edf7 100%);
  color: #0f172a;
}

.view-panel .view-actions-buttons {
  justify-content: flex-end;
}

.revenue-year-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 800;
}

.revenue-month-cell {
  font-weight: 800;
}

.revenue-total-row td {
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.92) 0%,
    rgba(30, 41, 59, 0.96) 100%
  ) !important;
  color: #fff !important;
}

.revenue-total-row .revenue-month-cell {
  color: #fff !important;
}
