/* EVA - Design Moderno 2024 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #0f766e;
  --primary-dark: #0b5e58;
  --primary-light: #14b8a6;
  --secondary: #0f766e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #ffffff;
  --bg-sidebar: #1e293b;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #0f766e 0%, #0b5e58 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Layout principal */
.site-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar moderna e compacta */
.sidebar {
  background: #ffffff;
  width: 220px;
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(15, 118, 110, 0.1);
}

.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  padding: 0 16px;
}

.header a.logo {
  font-size: 32px;
  font-weight: 800;
  color: white;
  text-decoration: none;
  letter-spacing: -1px;
  display: block;
  transition: var(--transition);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.header a.logo:hover {
  transform: scale(1.05);
  color: white;
}

/* Menu lateral moderno e compacto - Acordeão */
.menu {
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.menu-group {
  margin-bottom: 8px;
}

.menu-direct {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.menu-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  border-radius: 8px;
  margin: 0 8px;
}

.menu-group-header:hover {
  background: rgba(15, 118, 110, 0.08);
}

.menu-group-title {
  font-weight: 700;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  flex: 1;
}

.menu-group-icon {
  color: #94a3b8;
  font-size: 10px;
  transition: transform 0.3s ease;
  margin-left: 8px;
}

.menu-group.expanded .menu-group-icon {
  transform: rotate(90deg);
  color: var(--primary);
}

.menu-group.expanded .menu-group-title {
  color: var(--primary);
  opacity: 1;
}

.menu-group-items {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

.menu-group.expanded .menu-group-items {
  opacity: 1;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease 0.1s;
}

.menu-group li,
.menu-direct li {
  margin: 0;
}

.menu-direct-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin: 0 8px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.menu-direct-link:hover {
  background: rgba(15, 118, 110, 0.08);
}

.menu-direct-link.active .menu-group-title {
  color: var(--primary);
}

.menu-group a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 32px;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--transition);
  position: relative;
  min-height: 40px;
}

.menu-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #94a3b8;
  transition: var(--transition);
}

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

.menu-group a:hover .menu-item-icon,
.menu-group a.active .menu-item-icon {
  color: var(--primary);
}

.menu-group a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  transform: scaleY(0);
  transition: var(--transition);
}

.menu-group a:hover {
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-dark);
  border-left-color: var(--primary);
  padding-left: 36px;
}

.menu-group a:hover::before {
  transform: scaleY(1);
}

/* Indicador de página ativa */
.menu-group a.active {
  background: rgba(15, 118, 110, 0.15);
  color: var(--primary-dark);
  border-left-color: var(--primary);
  font-weight: 600;
}

.menu-group a.active::before {
  transform: scaleY(1);
}

/* Conteúdo principal */
.main-content {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f8fafc;
}

.content-inner {
  padding: 32px;
  flex: 1;
}

/* Header da página */
.rowHeader {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Breadcrumb elegante */
.breadcrumb-container {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.75);
  transition: var(--transition);
  padding: 4px 0;
}

.breadcrumb-item:not(.breadcrumb-active):hover {
  color: rgba(255, 255, 255, 0.9);
  transform: translateX(2px);
}

.breadcrumb-active {
  color: white;
  font-weight: 600;
  position: relative;
}

.breadcrumb-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.breadcrumb-icon {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  opacity: 0.9;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}

.breadcrumb-text {
  font-size: 15px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.breadcrumb-separator {
  color: rgba(255, 255, 255, 0.4);
  font-size: 16px;
  font-weight: 300;
  margin: 0 8px;
  user-select: none;
  opacity: 0.6;
  transition: var(--transition);
}

.breadcrumb-item:hover .breadcrumb-separator {
  opacity: 0.8;
}

.breadcrumb-item:last-child .breadcrumb-separator {
  display: none;
}

/* User menu dropdown */
.user-menu-container {
  position: relative;
}

.header-user {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.header-user:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.user-menu-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
  opacity: 0.7;
}

.user-menu-container.active .user-menu-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border: 1px solid rgba(15, 118, 110, 0.1);
  overflow: hidden;
}

.user-menu-container.active .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  border-bottom: 1px solid #f1f5f9;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary-dark);
}

.dropdown-item:last-child:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}

.dropdown-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* Login page moderna */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f766e 0%, #0b5e58 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.small-container {
  max-width: 440px;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.small-container h1 {
  color: var(--primary);
  margin: 0 0 8px 0;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.small-container h5 {
  color: var(--text-secondary);
  margin: 0 0 32px 0;
  font-weight: 400;
  font-size: 16px;
}

.login-form {
  text-align: center;
}

.login-erro {
  color: var(--danger);
  margin-bottom: 16px;
  font-size: 14px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
  border-left: 4px solid var(--danger);
}

.form-group {
  margin-top: 20px;
  text-align: left;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: 10px;
  transition: var(--transition);
  background: white;
  color: var(--text-primary);
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.btn-entrar {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-size: 16px;
  font-weight: 600;
  padding: 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 24px;
  box-shadow: var(--shadow-md);
}

.btn-entrar:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-entrar:active {
  transform: translateY(0);
}

/* Cards modernos */
.resumo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.resumo-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.resumo-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.alert1,
.alert2 {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  border: none;
  position: relative;
  overflow: hidden;
}

.alert1::before,
.alert2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.alert2::before {
  background: linear-gradient(90deg, var(--secondary) 0%, #34d399 100%);
}

.alert1:hover,
.alert2:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.alert2 {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.alert1 h4,
.alert2 h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alert2 h4 {
  color: rgba(255, 255, 255, 0.9);
}

.alert1 .valor-verde,
.alert1 .valor-preto {
  font-weight: 700;
  font-size: 28px;
  color: var(--success);
  display: block;
  margin-top: 8px;
}

.alert1 .valor-vermelho {
  font-weight: 700;
  font-size: 28px;
  color: var(--danger);
  display: block;
  margin-top: 8px;
}

.alert2 .valor-branco {
  color: white;
  font-weight: 700;
  font-size: 32px;
  display: block;
  margin-top: 8px;
}

.mt-0 {
  margin-top: 0;
}

/* Tabelas modernas */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  margin-top: 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.data-table th,
.data-table td {
  padding: 16px 20px;
  text-align: left;
}

.data-table th {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}

.data-table tr {
  transition: var(--transition);
}

.data-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.data-table tr:hover {
  background-color: rgba(15, 118, 110, 0.05);
  transform: scale(1.01);
}

.data-table td {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

/* Blocos de valor */
.valor-bloco {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.valor-bloco:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
}

.valor-bloco > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.valor-bloco h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.valor-bloco .vl {
  font-weight: 700;
  font-size: 32px;
  color: var(--success);
  display: block;
}

.valor-bloco--projetos .vl {
  color: var(--text-primary);
}

.projetos-total-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.valor-bloco-pago {
  color: var(--success) !important;
  font-weight: 700;
}

.valor-bloco-aberto {
  color: var(--danger) !important;
  font-weight: 700;
}

/* Página em construção */
.page-placeholder {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  color: var(--text-secondary);
  border: 2px dashed var(--border);
  box-shadow: var(--shadow-sm);
}

.page-placeholder code {
  background: rgba(15, 118, 110, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--primary);
  font-size: 13px;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Seletor de período (ano/mês) */
.period-selector {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.period-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.period-row.period-anos {
  margin-bottom: 12px;
}

.period-row.period-meses {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.period-item {
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: var(--transition);
}

.period-item:hover {
  color: var(--primary-dark);
  background: rgba(15, 118, 110, 0.1);
}

.period-item--active {
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.35);
}

.period-item--active:hover {
  color: white;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  transform: none;
}

.period-item--disabled {
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

.period-sep {
  color: var(--text-light);
  font-weight: 400;
  font-size: 14px;
  margin: 0 2px;
  user-select: none;
}

/* Despesas regulares: toolbar, busca, filtros */
.desp-reg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.desp-reg-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.desp-reg-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.5;
}

.desp-reg-search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  transition: var(--transition);
}

.desp-reg-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.desp-reg-filter-select {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.desp-reg-filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Linhas não pagas - destaque visual */
.desp-reg-row--unpaid {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.03) 100%) !important;
  border-left: 4px solid var(--warning);
}

.desp-reg-row--unpaid:hover {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.05) 100%) !important;
}

/* Linhas inativas (despesa "excluída" via Configuração) */
.desp-reg-row--inactive {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.10) 0%, rgba(148, 163, 184, 0.04) 100%) !important;
  border-left: 4px solid var(--text-light);
}

.desp-reg-row--inactive:hover {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.16) 0%, rgba(148, 163, 184, 0.06) 100%) !important;
  transform: none;
}

.desp-reg-row--inactive .desp-reg-desc-text,
.desp-reg-row--inactive .desp-reg-prev,
.desp-reg-row--inactive .desp-reg-pago-cell {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.6);
  text-decoration-thickness: 1px;
}

.desp-reg-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 999px;
  vertical-align: middle;
  text-decoration: none;
}

.desp-reg-tag--inactive {
  background: rgba(148, 163, 184, 0.22);
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.55);
}

/* Botões de pagamento */
.btn-pagar-mini {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-pagar-mini--pay {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-pagar-mini--pay:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}

.btn-pagar-mini--pay:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn-pagar-mini--edit {
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary-dark);
  border: 1px solid rgba(15, 118, 110, 0.4);
}

.btn-pagar-mini--edit:hover {
  background: rgba(15, 118, 110, 0.2);
  border-color: var(--primary);
}

.btn-pagar-mini--ok {
  background: var(--success);
  color: white;
  padding: 6px 12px;
  margin-left: 4px;
}

.btn-pagar-mini--cancel {
  background: var(--text-light);
  color: white;
  padding: 6px 12px;
  margin-left: 4px;
}

.desp-reg-edit-input {
  width: 100px;
  padding: 8px 12px;
  font-size: 14px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  margin-right: 4px;
}

.desp-reg-th-actions {
  width: 140px;
  text-align: center;
}

.desp-reg-actions {
  text-align: center;
}

.desp-reg-pago-empty {
  color: var(--text-light);
  font-style: italic;
}

/* DesGeral: dashboard compacto e elegante */
.desp-geral-page .container {
  max-width: 900px;
}

.desp-geral-dashboard {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  min-height: 0;
  transition: var(--transition);
}

.desp-geral-dashboard:hover {
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.12);
}

.desp-geral-metrics {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.desp-geral-metrics--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.desp-geral-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06) 0%, rgba(15, 118, 110, 0.02) 100%);
  border-radius: 10px;
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.desp-geral-metric:hover {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.1) 0%, rgba(15, 118, 110, 0.04) 100%);
  transform: translateX(4px);
}

.desp-geral-metric--total {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.03) 100%);
  border-left-color: var(--danger);
}

.desp-geral-metric--total:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.desp-geral-metric--destaque {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12) 0%, rgba(15, 118, 110, 0.05) 100%);
  border-left-color: var(--primary);
}

.desp-geral-metric--destaque:hover {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.18) 0%, rgba(15, 118, 110, 0.08) 100%);
}

.desp-geral-metric-value--verde {
  color: var(--success) !important;
}

.desp-geral-metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
}

.desp-geral-metric-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.desp-geral-metric--total .desp-geral-metric-value {
  color: var(--danger);
}

.desp-geral-chart-area {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desp-geral-chart-box {
  width: 100%;
  height: 100%;
  position: relative;
}

.desp-geral-chart-box canvas {
  max-width: 100%;
  max-height: 100%;
}

.desp-geral-chart-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-light);
  font-size: 13px;
}

.desp-geral-empty-icon {
  font-size: 32px;
  opacity: 0.6;
}

@media (max-width: 640px) {
  .desp-geral-dashboard {
    flex-direction: column;
    padding: 20px;
  }

  .desp-geral-metrics--grid {
    grid-template-columns: 1fr;
  }

  .desp-geral-chart-area {
    width: 180px;
    height: 180px;
  }
}

/* Despesas extraordinárias: toolbar e ações */
.desp-ext-toolbar {
  margin-bottom: 20px;
}

.desp-ext-total-layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.desp-ext-total-main {
  min-width: 0;
}

.desp-ext-total-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.desp-ext-total-side .btn-add {
  padding: 14px 26px;
  border-radius: 14px;
}

.desp-ext-total-meta {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
}

.desp-ext-th-actions {
  width: 180px;
  text-align: center;
}

.desp-ext-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.desp-ext-list .desp-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #FAECE7;
  color: #993C1D;
  box-shadow: none;
}

.desp-ext-svg-icon {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.desp-ext-svg-icon--bolt {
  width: 16px;
  height: 16px;
}

.desp-ext-list .desp-card-actions {
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.desp-ext-list .desp-card:hover .desp-card-actions,
.desp-ext-list .desp-card:focus-within .desp-card-actions {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.desp-ext-btn-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #6B6E6A;
  background: transparent;
  border: 1px solid #D6D9D6;
  border-radius: 8px;
  box-shadow: none;
}

.desp-ext-btn-edit .desp-ext-svg-icon--edit {
  color: #6B6E6A;
}

.desp-ext-btn-edit:hover {
  background: #F7F8F7;
  border-color: #C5C9C5;
  color: #4F534F;
  transform: none;
  box-shadow: none;
}

.desp-ext-btn-delete {
  width: 16px;
  height: 16px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #E24B4A;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.desp-ext-btn-delete .desp-ext-svg-icon--delete {
  color: #E24B4A;
}

.desp-ext-btn-delete:hover {
  background: transparent;
  border: 0;
  color: #C93B3A;
  transform: none;
  box-shadow: none;
}

.btn-pagar-mini--delete {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-pagar-mini--delete:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-color: #ef4444;
}

/* Configuração de despesas regulares (ConfigDespReg) */
.cfg-desp-lead {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  max-width: 720px;
  line-height: 1.5;
}

.cfg-desp-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin: 10px 0 12px;
}

.cfg-desp-tabs-content {
  min-height: 0;
  width: 100%;
  padding: 0;
}

.cfg-desp-tabs .dashboard-tab-pane,
.cfg-desp-tabs .dashboard-tab-pane--active {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.cfg-desp-tabs .dashboard-tab-pane {
  display: none;
}

.cfg-desp-tabs .dashboard-tab-pane--active {
  display: block;
}

.cfg-desp-tab-pane {
  width: 100%;
  max-width: none;
  margin: 0;
}

.cfg-desp-total-bloco .cfg-desp-total-hint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-secondary);
  font-size: 11px;
}

.cfg-desp-total-bloco {
  padding: 30px 32px;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.cfg-desp-total-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cfg-desp-total-vl {
  color: var(--primary) !important;
}

.cfg-desp-total-meta {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.cfg-desp-add-class-hint {
  margin: -2px 0 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.cfg-desp-modal-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 13px;
  color: #92400e;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  line-height: 1.4;
}

#modalAddCfgDesp {
  align-items: flex-start;
  overflow-y: auto;
  padding: 20px 0;
}

#modalAddCfgDesp .modal-content {
  max-height: calc(100vh - 40px);
  margin: 0 auto;
}

#modalAddCfgDesp .modal-header {
  padding: 18px 22px;
}

#modalAddCfgDesp .modal-content form {
  padding: 18px 22px;
}

#modalAddCfgDesp .modal-content .form-group {
  margin-bottom: 14px;
}

#modalAddCfgDesp .cfg-desp-modal-alert {
  margin-bottom: 10px;
  padding: 8px 10px;
}

#modalAddCfgDesp .cfg-desp-add-class-hint {
  margin: -2px 0 8px;
}

#modalAddCfgDesp .modal-actions {
  margin-top: 14px;
  padding-top: 14px;
}

.cfg-desp-th-actions {
  width: 200px;
  text-align: center;
}

.cfg-desp-table th.cfg-desp-th-actions,
.cfg-desp-table td:last-child {
  text-align: center;
}

.cfg-desp-table td .desp-ext-actions {
  width: 100%;
  justify-content: center;
}

.cfg-desp-tab-pane .desp-ext-table-wrap {
  width: 100%;
  margin: 0;
}

.cfg-desp-row--inactive td:not(.desp-ext-actions) {
  opacity: 0.55;
}

.cfg-desp-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.cfg-desp-badge--sim {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.cfg-desp-badge--nao {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Tela Bancos — reutiliza padrão cfg-desp */
.bancos-tabs .dashboard-tabs-header {
  flex-wrap: wrap;
  gap: 4px;
}

.bancos-tabs .dashboard-tab-btn {
  min-width: 100px;
}

.bancos-novo-fundo {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
}

.bancos-novo-fundo .cfg-desp-add-class-hint {
  margin-bottom: 12px;
}

.bancos-poup-lista {
  margin-top: 20px;
}

.bancos-poup-card-fundo {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.4;
}

.bancos-poup-card-fundo strong {
  color: var(--text-primary);
  font-weight: 600;
}

.bancos-poup-lista .projeto-edit-btn {
  text-decoration: none;
}

.bancos-projetos-lista {
  margin-top: 20px;
}

.bancos-projeto-card-header {
  padding: 20px 24px;
}

.bancos-projetos-lista .projeto-card-header {
  align-items: center;
}

.bancos-investimentos-lista {
  margin-top: 20px;
}

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

.bancos-invest-meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

.bancos-invest-card-body {
  padding: 20px 28px 24px;
  background: var(--bg-card);
}

.bancos-invest-saldos {
  margin-bottom: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.bancos-invest-saldos .info-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06) 0%, rgba(15, 118, 110, 0.02) 100%);
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.bancos-invest-saldos .info-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--text-secondary);
}

.bancos-invest-saldos .info-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.bancos-invest-dif--pos {
  color: var(--success);
}

.bancos-invest-dif--neg {
  color: #b42318;
}

@media (max-width: 900px) {
  .bancos-invest-saldos {
    grid-template-columns: 1fr;
  }

  .bancos-invest-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .bancos-invest-card-header .projeto-card-actions {
    justify-content: flex-end;
  }
}

.form-group--checkbox label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}

.form-group--checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.modal-content .form-group--checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

/* Lista moderna de projetos */
.projetos-lista {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.projeto-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.projeto-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.projeto-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(15, 118, 110, 0.3);
}

.projeto-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.05) 0%, rgba(15, 118, 110, 0.02) 100%);
  border-bottom: 1px solid var(--border);
}

.projeto-card-title {
  flex: 1;
  min-width: 0;
}

.projeto-card-title h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.projeto-card-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.projeto-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 32px;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.projeto-card:hover .projeto-card-actions,
.projeto-card:focus-within .projeto-card-actions,
.projeto-card-actions:focus-within {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.projeto-card-percent {
  display: flex;
  align-items: center;
}

.projeto-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: var(--transition);
}

.projeto-edit-btn:hover,
.projeto-edit-btn:focus-visible {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.18);
  color: var(--primary-dark);
  outline: none;
}

.projeto-edit-btn:active {
  transform: translateY(1px);
}

.projeto-detail-btn[aria-expanded='true'] {
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.18);
  color: var(--primary-dark);
}

.projeto-detail-btn__chevron {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.projeto-detail-btn[aria-expanded='true'] .projeto-detail-btn__chevron {
  transform: rotate(180deg);
}

.projeto-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #b42318;
  cursor: pointer;
  transition: var(--transition);
}

.projeto-delete-btn:hover,
.projeto-delete-btn:focus-visible {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
  outline: none;
}

.projeto-delete-btn:active {
  transform: translateY(1px);
}

.projeto-delete-btn__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.projeto-edit-btn__icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  opacity: 0.85;
  flex-shrink: 0;
}

.projeto-edit-btn:hover .projeto-edit-btn__icon,
.projeto-edit-btn:focus-visible .projeto-edit-btn__icon {
  opacity: 1;
}

.percent-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary) 0deg, 
    var(--primary) calc(var(--percent, 0) * 3.6deg), 
    #e2e8f0 calc(var(--percent, 0) * 3.6deg), 
    #e2e8f0 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-md);
}

.percent-circle::before {
  content: '';
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
}

.percent-value {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1;
}

.percent-caption {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  color: #6B6E6A;
  letter-spacing: 0.2px;
  line-height: 1;
}

.percent-circle {
  flex-direction: column;
}

/* Bloco de valor exibido no header do projeto-card quando não há círculo de porcentagem
   (ex.: caixinhas de poupança). Mantém o mesmo "peso visual" do percent-circle. */
.caixinha-card-valor {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 120px;
  padding: 10px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.10) 0%, rgba(15, 118, 110, 0.04) 100%);
  border: 1px solid rgba(15, 118, 110, 0.18);
  box-shadow: var(--shadow-sm);
}

.caixinha-card-valor--attention {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12) 0%, rgba(217, 119, 6, 0.04) 100%);
  border-color: rgba(217, 119, 6, 0.22);
}

.caixinha-card-valor__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-bottom: 6px;
}

.caixinha-card-valor__amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
  line-height: 1.1;
  white-space: nowrap;
}

.caixinha-card-valor__amount--meta {
  color: var(--text-primary);
}

.caixinha-card-valor--attention .caixinha-card-valor__amount {
  color: #d97706;
}

.caixinha-card-valor__hint {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #92400e;
  letter-spacing: 0.45px;
  line-height: 1;
  text-transform: uppercase;
}

/* No layout do projeto-card, o card-header conserva o body abaixo.
   Em PoupCaixinhas o card não tem body — adicionamos um respiro visual
   reduzindo o padding inferior do header para um card mais compacto. */
.projeto-card:not(:has(.projeto-card-body)) .projeto-card-header {
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: none;
}

.projeto-card-body {
  padding: 24px 28px;
  transition: padding 0.25s ease;
}

.projeto-card:not(.is-detalhes-open) .projeto-card-body {
  padding-top: 14px;
  padding-bottom: 18px;
}

.projeto-card:not(.is-detalhes-open) .projeto-progress {
  margin-top: 0;
  padding-top: 14px;
  border-top-width: 1px;
}

.projeto-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.projeto-info-grid[hidden] {
  display: none;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-label__icon {
  width: 14px;
  height: 14px;
  color: #6B6E6A;
  flex-shrink: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.info-value--falta {
  color: var(--danger);
}

.projeto-progress {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 10px;
  transition: width 0.6s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

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

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-label--falta {
  color: var(--text-secondary);
  font-weight: 500;
}

.proj-edit-alert {
  margin: 20px 0 0;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  padding: 12px 14px;
  font-weight: 600;
}

.proj-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
}

.proj-edit-modal.is-open {
  display: block;
}

.proj-edit-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.proj-edit-modal__dialog {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  margin: 48px auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.proj-edit-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08) 0%, rgba(15, 118, 110, 0.02) 100%);
}

.proj-edit-modal__header h3 {
  margin: 0;
  color: var(--text-primary);
}

.proj-edit-modal__close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
}

.proj-edit-form {
  padding: 20px 24px 24px;
}

.proj-edit-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.proj-edit-form__grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proj-edit-form__grid span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.proj-edit-form__grid input,
.proj-edit-form__grid select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
}

.proj-edit-form__check {
  align-self: end;
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
}

.proj-edit-form__check input {
  width: auto !important;
}

.proj-edit-form__check span {
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-primary);
}

.proj-edit-form__actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.proj-btn {
  border-radius: 10px;
  padding: 10px 16px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
}

.proj-btn--ghost {
  border-color: var(--border);
  background: #fff;
  color: var(--text-primary);
}

.proj-btn--primary {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 180px;
}

.proj-btn--primary:disabled,
.proj-btn--primary[aria-disabled='true'] {
  cursor: progress;
  opacity: 0.85;
}

.proj-btn.is-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: projBtnSpin 0.7s linear infinite;
}

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

.proj-saving-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.proj-saving-overlay.is-visible {
  opacity: 1;
}

.proj-saving-overlay[hidden] {
  display: none;
}

.proj-saving-overlay__panel {
  max-width: 380px;
  text-align: center;
  padding: 28px 32px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 18, 0.25);
}

.proj-saving-overlay__spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border: 3px solid rgba(15, 118, 110, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: projSavingSpin 0.75s linear infinite;
}

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

.proj-saving-overlay__title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.proj-saving-overlay__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .proj-edit-form__grid {
    grid-template-columns: 1fr;
  }

  .projeto-card-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .projeto-card-actions {
    order: 3;
    margin-right: 0;
    margin-left: auto;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .projeto-card-percent {
    order: 2;
  }

  .caixinha-card-valor {
    order: 2;
    align-items: flex-start;
    min-width: 0;
  }
}

/* Lista moderna de projetos geral */
.projetos-geral-lista {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.projeto-geral-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  padding: 20px;
  width: 100%;
}

.projeto-geral-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.projeto-geral-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(15, 118, 110, 0.3);
}

.projeto-geral-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.projeto-geral-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.projeto-geral-icon {
  font-size: 32px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.1);
  border-radius: 12px;
  flex-shrink: 0;
}

.projeto-geral-details {
  flex: 1;
  min-width: 0;
}

.projeto-geral-name {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  word-wrap: break-word;
}

.projeto-geral-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--success);
  display: block;
}

.projeto-geral-stats {
  display: flex;
  align-items: center;
  margin-left: 16px;
}

.projeto-geral-percent-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary) 0deg, 
    var(--primary) calc(var(--percent, 0) * 3.6deg), 
    #e2e8f0 calc(var(--percent, 0) * 3.6deg), 
    #e2e8f0 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.projeto-geral-percent-circle::before {
  content: '';
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
}

.projeto-geral-percent-value {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

.projeto-geral-progress {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.projeto-geral-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.projeto-geral-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 10px;
  transition: width 0.6s ease;
  position: relative;
  overflow: hidden;
}

.projeto-geral-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Lista moderna de projetos saldo */
.projetos-saldo-lista {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.projeto-saldo-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  padding: 24px 28px;
  width: 100%;
}

.projeto-saldo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.projeto-saldo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(15, 118, 110, 0.3);
}

.projeto-saldo-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.projeto-saldo-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.projeto-saldo-icon {
  font-size: 36px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.15) 0%, rgba(15, 118, 110, 0.08) 100%);
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.projeto-saldo-details {
  flex: 1;
  min-width: 0;
}

.projeto-saldo-name {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  word-wrap: break-word;
}

.projeto-saldo-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.projeto-saldo-value {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.projeto-saldo-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
  background: linear-gradient(135deg, var(--success) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Lista moderna de poupança caixinhas */
.poup-caixinhas-lista {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.poup-caixinha-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  padding: 20px 24px;
  width: 100%;
}

.poup-caixinha-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.poup-caixinha-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(15, 118, 110, 0.3);
}

.poup-caixinha-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.poup-caixinha-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.poup-caixinha-icon {
  font-size: 36px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.15) 0%, rgba(15, 118, 110, 0.08) 100%);
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.poup-caixinha-details {
  flex: 1;
  min-width: 0;
}

.poup-caixinha-name {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  word-wrap: break-word;
}

.poup-caixinha-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--success);
  display: block;
}

.poup-caixinha-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}

/* Botões modernos */
.btn-add {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.btn-add::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-add:hover::before {
  width: 400px;
  height: 400px;
}

.btn-add:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.4);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.btn-add:active {
  transform: translateY(0) scale(0.98);
}

.btn-add .btn-icon {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  line-height: 1;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-add .btn-icon .btn-add__svg-icon {
  width: 18px;
  height: 18px;
  color: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  flex-shrink: 0;
}

.btn-add span:not(.btn-icon) {
  position: relative;
  z-index: 1;
}

.btn-action {
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.2px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-action::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-action:hover::before {
  width: 300px;
  height: 300px;
}

.btn-action span,
.btn-action {
  position: relative;
  z-index: 1;
}

.btn-edit {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12) 0%, rgba(15, 118, 110, 0.08) 100%);
  color: var(--primary-dark);
  border: 2px solid rgba(15, 118, 110, 0.4);
}

.btn-edit:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
}

.btn-edit:active {
  transform: translateY(0) scale(0.98);
}

.btn-delete {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.08) 100%);
  color: #dc2626;
  border: 2px solid rgba(239, 68, 68, 0.4);
}

.btn-delete:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-color: #ef4444;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.btn-delete:active {
  transform: translateY(0) scale(0.98);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  font-size: 32px;
  font-weight: 300;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.modal-content form {
  padding: 28px;
}

.modal-content .form-group {
  margin-bottom: 20px;
}

.modal-content .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.modal-content .form-group input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: var(--transition);
  box-sizing: border-box;
}

.modal-content .form-group select {
  width: 100%;
  padding: 12px 42px 12px 16px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background-color: #fff;
  color: var(--text-primary);
  transition: var(--transition);
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.modal-content .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.modal-content .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.modal-content .form-group.form-group--checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  font-weight: 600;
}

.modal-content .form-group.form-group--checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: none;
  box-shadow: none;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn-cancel {
  padding: 14px 28px;
  background: white;
  color: var(--text-secondary);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

.btn-cancel::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-cancel:hover::before {
  width: 300px;
  height: 300px;
}

.btn-cancel:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-primary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-cancel:active {
  transform: translateY(0) scale(0.98);
}

.btn-save {
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

.btn-save::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-save:hover::before {
  width: 400px;
  height: 400px;
}

.btn-save:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.4);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.btn-save:active {
  transform: translateY(0) scale(0.98);
}

/* Sistema de notificações toast */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 16px 20px;
  min-width: 320px;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  border-left: 4px solid;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.3;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left-color: var(--success);
  color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
  color: var(--danger);
}

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.toast-message {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

/* Modal de confirmação */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.confirm-modal.show {
  opacity: 1;
}

.confirm-content {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.confirm-modal.show .confirm-content {
  transform: scale(1);
}

.confirm-content--delete .btn-confirm {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.confirm-content--delete .btn-confirm:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4);
}

.confirm-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.confirm-content h3 {
  margin: 0 0 12px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.confirm-content p {
  margin: 0 0 24px 0;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-confirm {
  padding: 14px 28px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  letter-spacing: 0.2px;
}

.btn-confirm:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.btn-confirm:active {
  transform: translateY(0) scale(0.98);
}

/* Modal de loading */
.loading-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 2600;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loading-modal.show {
  opacity: 1;
}

.loading-content {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 40px 50px;
  text-align: center;
  min-width: 280px;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.loading-modal.show .loading-content {
  transform: scale(1);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid rgba(15, 118, 110, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-message {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

/* Scrollbar moderna */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(15, 118, 110, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 118, 110, 0.8);
}

/* Scrollbar específico para o menu */
.menu::-webkit-scrollbar {
  width: 4px;
}

.menu::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.menu::-webkit-scrollbar-thumb {
  background: rgba(15, 118, 110, 0.3);
  border-radius: 2px;
}

.menu::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 118, 110, 0.5);
}

/* Animações suaves */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-inner {
  animation: fadeIn 0.5s ease-out;
}

.alert1,
.alert2,
.valor-bloco,
.data-table {
  animation: fadeIn 0.6s ease-out;
}

/* Melhorias nos cards */
.alert1 h4:first-child,
.alert2 h4:first-child {
  margin-top: 0;
}


/* Responsividade */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }
  
  .main-content {
    margin-left: 200px;
  }
  
  .resumo-grid {
    grid-template-columns: 1fr;
  }
  
  .content-inner {
    padding: 20px;
  }
  
  .rowHeader {
    padding: 0 16px;
    flex-direction: column;
    height: auto;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  
  .header-tela {
    font-size: 16px;
    margin-bottom: 8px;
  }
  
  .header a.logo {
    font-size: 28px;
  }
  
  .menu-group a {
    font-size: 13px;
    padding: 8px 12px;
  }
}


/* ========== Dashboard Premium ========== */

/* --- Animação de entrada escalonada --- */
@keyframes kpiFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kpi-animate {
  opacity: 0;
  animation: kpiFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--kpi-delay, 0) * 80ms + 100ms);
}

/* --- ResumoGrafico: overlay de carregamento --- */
.dashboard-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(250, 251, 249, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.dashboard-loading-overlay--out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dashboard-loading-overlay--hidden {
  display: none !important;
}

.dashboard-loading-panel {
  max-width: 380px;
  text-align: center;
  padding: 28px 32px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #F0F2EF;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 18, 0.18);
}

.dashboard-loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid #E8EDE9;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: dashboardLoadingSpin 0.75s linear infinite;
}

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

.dashboard-loading-title {
  margin: 0 0 10px;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1A1D1A;
}

.dashboard-loading-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #6B6E6A;
}

/* --- Layout da página --- */
.dashboard-page {
  max-width: 1400px;
  margin: 0 auto;
  font-family: 'Outfit', 'Inter', sans-serif;
}

/* --- Hero --- */
.dashboard-hero {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--primary-light) 100%);
  border-radius: var(--radius-lg);
  padding: 22px 36px;
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow:
    0 20px 40px -14px rgba(15, 118, 110, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.dashboard-hero-glow {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.dashboard-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.dashboard-hero-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dashboard-hero-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.dashboard-hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-title {
  font-family: 'Syne', 'Outfit', 'Inter', sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: white;
  margin: 0;
  letter-spacing: -0.8px;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}

.dashboard-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin: 2px 0 0 0;
  font-weight: 400;
}

.dashboard-hero-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 0;
  background: transparent;
  border: none;
  text-align: right;
}

.dashboard-hero-total-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.82);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
}

.dashboard-hero-total-value {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.4px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.dashboard-hero-saldo-label {
  margin-top: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.80);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.dashboard-hero-saldo-value {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.2px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

@media (max-width: 760px) {
  .dashboard-hero {
    padding: 18px 22px;
  }
  .dashboard-hero-content {
    gap: 16px;
  }
  .dashboard-hero-right {
    width: 100%;
    justify-content: flex-start;
  }
  .dashboard-hero-total {
    align-items: flex-start;
    text-align: left;
  }
  .dashboard-title {
    font-size: 28px;
  }
  .dashboard-hero-total-value {
    font-size: 22px;
  }
  .dashboard-hero-saldo-value {
    font-size: 16px;
  }
}

/* --- Título de seção com barra decorativa --- */
.dashboard-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 24px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-section-title-bar {
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
  flex-shrink: 0;
}

/* --- KPI Grid --- */
.dashboard-kpis {
  margin-bottom: 44px;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

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

/* --- KPI Card --- */
.dashboard-kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 24px 20px;
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 16px;
  row-gap: 4px;
  align-items: start;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s ease;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.06);
}

.dashboard-kpi-card--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.dashboard-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 3px 3px 0 0;
}

.dashboard-kpi-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 8px 24px rgba(15, 118, 110, 0.12),
    0 20px 48px -8px rgba(0, 0, 0, 0.10);
  border-color: rgba(15, 118, 110, 0.25);
}

.dashboard-kpi-glow {
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(15, 118, 110, 0.04) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.dashboard-kpi-card:hover .dashboard-kpi-glow {
  opacity: 1;
}

.dashboard-kpi-card--essencial::before {
  background: linear-gradient(90deg, #0f766e 0%, #14b8a6 100%);
}

.dashboard-kpi-card--pessoal::before {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.dashboard-kpi-card--total::before {
  background: linear-gradient(90deg, #64748b 0%, #94a3b8 100%);
}

.dashboard-kpi-card--extraordinario::before {
  background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
}

.dashboard-kpi-card--emergencia::before {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.dashboard-kpi-card--provisionamento::before {
  background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
}

/* --- Ícone com gradiente circular --- */
.dashboard-kpi-icon-wrap {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: start;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12) 0%, rgba(20, 184, 166, 0.06) 100%);
  transition: transform 0.3s ease;
}

.dashboard-kpi-card:hover .dashboard-kpi-icon-wrap {
  transform: scale(1.08);
}

.dashboard-kpi-icon {
  font-size: 28px;
  line-height: 1;
}

.dashboard-kpi-icon-svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.8;
}

.dashboard-kpi-icon-wrap--essencial {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.15) 0%, rgba(20, 184, 166, 0.06) 100%);
  color: #0f766e;
}

.dashboard-kpi-icon-wrap--pessoal {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(96, 165, 250, 0.06) 100%);
  color: #3b82f6;
}

.dashboard-kpi-icon-wrap--total {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.15) 0%, rgba(148, 163, 184, 0.06) 100%);
  color: #64748b;
}

.dashboard-kpi-icon-wrap--extraordinario {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(249, 115, 22, 0.06) 100%);
  color: #ef4444;
}

.dashboard-kpi-icon-wrap--emergencia {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.06) 100%);
  color: #10b981;
}

.dashboard-kpi-icon-wrap--provisionamento {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(167, 139, 250, 0.06) 100%);
  color: #8b5cf6;
}

/* --- KPI Conteúdo --- */
.dashboard-kpi-content {
  display: contents;
}

.dashboard-kpi-label {
  grid-column: 2;
  grid-row: 1;
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.dashboard-kpi-value {
  grid-column: 2;
  grid-row: 2;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.dashboard-kpi-value--verde {
  color: var(--success) !important;
}

.dashboard-kpi-value--vermelho {
  color: var(--danger) !important;
}

.dashboard-kpi-hint {
  grid-column: 2;
  grid-row: 3;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 3px;
  display: block;
}

/* --- Chart Cards --- */
.dashboard-charts {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 36px;
}

.dashboard-chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  border: 1px solid var(--border);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.dashboard-chart-card:hover {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 12px 32px -4px rgba(0, 0, 0, 0.06);
}

.dashboard-chart-card--donut .dashboard-chart-container--small {
  max-width: 400px;
  height: 320px;
  margin: 0 auto;
}

.dashboard-chart-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.dashboard-chart-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
}

.dashboard-chart-container {
  position: relative;
  height: 320px;
}

.dashboard-chart-container--small {
  height: 260px;
  max-width: 280px;
  margin: 0 auto;
  position: relative;
}

.dashboard-chart-card--full {
  width: 100%;
}

/* --- Tabs --- */
.dashboard-tabs {
  margin-top: 16px;
}

.dashboard-tabs-header {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.dashboard-tab-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  border-radius: 8px 8px 0 0;
  letter-spacing: 0.2px;
}

.dashboard-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(15, 118, 110, 0.04);
}

.dashboard-tab-btn--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(15, 118, 110, 0.06);
}

.dashboard-tabs-content {
  position: relative;
  min-height: 280px;
}

.dashboard-tab-pane {
  display: none;
}

.dashboard-tab-pane--active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.dashboard-chart-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.dashboard-chart-empty {
  display: none;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  font-size: 14px;
  color: var(--text-secondary);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* --- Insight Card --- */
.dashboard-insight-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06) 0%, rgba(20, 184, 166, 0.02) 100%);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.dashboard-insight-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12) 0%, rgba(20, 184, 166, 0.06) 100%);
  border-radius: 14px;
  flex-shrink: 0;
}

.dashboard-insight-icon {
  font-size: 24px;
  line-height: 1;
}

.dashboard-insight-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.dashboard-insight-text strong {
  color: var(--primary-dark);
}

/* ========== KPI Compact Premium (ResumoGrafico) ========== */
.dashboard-kpis .dashboard-kpi-icon-wrap,
.dashboard-kpis .dashboard-kpi-glow {
  display: none !important;
}

.dashboard-kpis .dashboard-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  min-height: 96px;
  display: block;
  transform: none;
}

.dashboard-kpis .dashboard-kpi-card::before {
  display: none;
}

.dashboard-kpis .dashboard-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.dashboard-kpis .dashboard-kpi-content {
  display: block;
}

.dashboard-kpis .dashboard-kpi-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.6px;
  margin: 0 0 4px 0;
  color: var(--text-secondary);
}

.dashboard-kpis .dashboard-kpi-value,
.dashboard-kpis .dashboard-kpi-value--verde,
.dashboard-kpis .dashboard-kpi-value--vermelho {
  display: block;
  font-size: 22px;
  line-height: 1.15;
  margin: 0;
  color: var(--text-primary) !important;
}

.dashboard-kpis .dashboard-kpi-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-light);
}

/* ============================================================
   Despesas Regulares — Lista premium (DesEss / DesPes)
   ============================================================ */
.desp-summary {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.5s ease-out;
}

.desp-summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.desp-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.desp-summary-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.desp-summary-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--primary);
}

.desp-summary-title h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.desp-summary-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.desp-summary-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.18);
  padding: 6px 12px;
  border-radius: 999px;
}

.desp-summary-count--danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.poup-manut-summary-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.poup-fundo-config {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06) 0%, rgba(15, 118, 110, 0.02) 100%);
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.desp-summary .poup-fundo-config {
  margin-top: 18px;
  margin-bottom: 0;
}

.valor-bloco .poup-fundo-config {
  margin-top: 18px;
  margin-bottom: 0;
}

.poup-fundo-config__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.poup-fundo-config__icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.poup-fundo-config__control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
}

.poup-fundo-config__select {
  min-width: 180px;
  max-width: 320px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 10px;
  background: #fff;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6E6A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.poup-fundo-config__select:hover,
.poup-fundo-config__select:focus-visible {
  border-color: rgba(15, 118, 110, 0.45);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.poup-fundo-config__select:disabled {
  opacity: 0.65;
  cursor: wait;
}

.poup-fundo-config__status {
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.poup-fundo-config__status.is-visible {
  opacity: 1;
}

.poup-fundo-config__status.is-error {
  color: var(--danger);
}

.desp-summary .btn-add {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
}

.desp-summary .btn-add .btn-icon {
  font-size: 18px;
}

.desp-summary-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.desp-kpi {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.desp-kpi::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-light);
  opacity: 0.6;
}

.desp-kpi--prev::before { background: linear-gradient(180deg, var(--primary), var(--primary-light)); }
.desp-kpi--pago::before { background: linear-gradient(180deg, var(--success), #059669); }
.desp-kpi--aberto::before { background: linear-gradient(180deg, var(--warning), #d97706); }

.desp-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.desp-kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.desp-kpi-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.desp-kpi--pago .desp-kpi-value { color: var(--success); }
.desp-kpi--aberto .desp-kpi-value { color: #d97706; }
.desp-kpi--prev .desp-kpi-value { color: var(--primary-dark); }

/* ============================================================
   Poupança Geral — Variação do desp-summary
   Hero KPIs em duo + bloco de Composição (breakdown + donut)
   ============================================================ */

.desp-summary-kpis--duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.desp-summary-kpis--solo {
  grid-template-columns: minmax(0, 1fr);
}

.desp-summary-kpis--solo .desp-kpi {
  padding: 18px 22px;
}

.desp-summary-kpis--solo .desp-kpi-value {
  font-size: 28px;
}

.desp-kpi--despesa-total::before {
  background: linear-gradient(180deg, #ef4444, #dc2626);
}
.desp-kpi--despesa-total {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.02) 100%);
}
.desp-kpi--despesa-total .desp-kpi-value {
  color: var(--danger);
}

.desp-kpi--despesa-essenciais::before {
  background: linear-gradient(180deg, #0f766e, #14b8a6);
}
.desp-kpi--despesa-essenciais .desp-kpi-value {
  color: var(--primary-dark);
}

.desp-kpi--despesa-pessoais::before {
  background: linear-gradient(180deg, #10b981, #34d399);
}
.desp-kpi--despesa-pessoais .desp-kpi-value {
  color: var(--success);
}

.desp-kpi--poup-caixinhas::before {
  background: linear-gradient(180deg, #0f766e, #14b8a6);
}
.desp-kpi--poup-caixinhas .desp-kpi-value {
  color: var(--primary-dark);
}

.desp-kpi--poup-emergencia::before {
  background: linear-gradient(180deg, #10b981, #34d399);
}
.desp-kpi--poup-emergencia .desp-kpi-value {
  color: var(--success);
}

.desp-kpi--poup-manutencoes::before {
  background: linear-gradient(180deg, #0b5e58, #0d7e74);
}
.desp-kpi--poup-manutencoes .desp-kpi-value {
  color: #0b5e58;
}

.poup-geral-composition {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.poup-geral-composition-title {
  margin-bottom: 14px;
}

.poup-geral-composition-body {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 28px;
  align-items: center;
}

.poup-geral-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.poup-geral-chart-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.poup-geral-chart-box {
  width: 220px;
  height: 220px;
  position: relative;
}

.poup-geral-chart-box canvas {
  max-width: 100%;
  max-height: 100%;
}

.poup-geral-chart-empty {
  width: 200px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-light);
  font-size: 13px;
  border: 1.5px dashed var(--border);
  border-radius: 50%;
  text-align: center;
}

.poup-geral-chart-empty p {
  margin: 0;
}

.poup-geral-chart-empty-icon {
  font-size: 32px;
  opacity: 0.6;
}

.desp-summary-progress {
  margin-top: 18px;
  height: 8px;
  background: rgba(15, 118, 110, 0.08);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.desp-summary-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--success) 0%, #059669 100%);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.desp-summary-progress-pct {
  position: absolute;
  right: 0;
  top: -22px;
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  letter-spacing: 0.3px;
}

/* Toolbar (busca + filtros) */
.desp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.desp-search {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.desp-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: 0.7;
  pointer-events: none;
}

.desp-search-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  transition: var(--transition);
  font-family: inherit;
  color: var(--text-primary);
}

.desp-search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.desp-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.desp-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f1f5f9;
  border: 1.5px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.desp-filter-chip:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.desp-filter-chip.is-active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.28);
}

.desp-filter-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-light);
  flex-shrink: 0;
}

.desp-filter-chip-dot--success { background: var(--success); }
.desp-filter-chip-dot--warning { background: var(--warning); }
.desp-filter-chip-dot--neutral { background: var(--text-light); }

.desp-filter-chip.is-active .desp-filter-chip-dot {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* Lista de cards */
.desp-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
  animation: fadeIn 0.5s ease-out;
}

.desp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.desp-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-light);
  opacity: 0.5;
  transition: var(--transition);
}

.desp-card--paid::before {
  background: linear-gradient(180deg, var(--success) 0%, #059669 100%);
  opacity: 1;
}

.desp-card--unpaid::before {
  background: linear-gradient(180deg, var(--warning) 0%, #d97706 100%);
  opacity: 1;
}

.desp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(15, 118, 110, 0.25);
}

.desp-card-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.desp-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12) 0%, rgba(20, 184, 166, 0.06) 100%);
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.desp-card--paid .desp-card-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.08) 100%);
  color: var(--success);
}

.desp-card--unpaid .desp-card-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.08) 100%);
  color: #d97706;
}

.desp-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.desp-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.desp-card-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.desp-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.desp-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
}

.desp-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}

.desp-card--paid .desp-stat-value.desp-reg-pago-val { color: var(--success); }
.desp-card--unpaid .desp-stat-value.desp-reg-pago-empty { color: var(--text-light); font-style: italic; font-weight: 600; }

.desp-stat-sep {
  color: var(--border);
  font-size: 12px;
}

.desp-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.desp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 999px;
}

.desp-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.desp-status-badge--paid {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.desp-status-badge--unpaid {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.desp-status-badge--inactive {
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.desp-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.desp-card-actions .btn-pagar-mini--pay {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: #ffffff;
  border: 1.5px solid transparent;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
}

.desp-card-actions .btn-pagar-mini--pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

/* Botão "Editar" usa o padrão flat de ProjetosDetalhes (.projeto-edit-btn).
   Mantemos a classe .btn-pagar-mini--edit no markup apenas como hook de JS.
   Em DesEss/DesPes ele só aparece quando o card recebe hover/focus,
   replicando o comportamento de DesExt. */
.desp-list .desp-card-actions .projeto-edit-btn {
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease,
              background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.desp-list .desp-card:hover .desp-card-actions .projeto-edit-btn,
.desp-list .desp-card:focus-within .desp-card-actions .projeto-edit-btn {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.desp-reg-edit-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.desp-reg-edit-input {
  width: 110px;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  background: #ffffff;
}

.desp-reg-edit-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.btn-pagar-mini--ok,
.btn-pagar-mini--cancel {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-pagar-mini--ok {
  background: var(--success);
  color: #ffffff;
}

.btn-pagar-mini--ok:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-pagar-mini--cancel {
  background: #f1f5f9;
  color: var(--text-secondary);
}

.btn-pagar-mini--cancel:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

/* Estado inativo (histórico de despesas inativadas) */
.desp-card--inactive {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.08) 0%, rgba(148, 163, 184, 0.02) 100%);
  border-color: rgba(148, 163, 184, 0.35);
}

.desp-card--inactive::before {
  background: linear-gradient(180deg, var(--text-light) 0%, #94a3b8 100%) !important;
  opacity: 1;
}

.desp-card--inactive .desp-card-icon {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.22) 0%, rgba(148, 163, 184, 0.10) 100%);
  color: #475569;
}

.desp-card--inactive .desp-card-title-text,
.desp-card--inactive .desp-stat-value {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.65);
  text-decoration-thickness: 1px;
}

.desp-card--inactive .desp-stat-label,
.desp-card--inactive .desp-stat-sep {
  color: var(--text-light);
}

.desp-card--inactive:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: rgba(148, 163, 184, 0.5);
}

.desp-reg-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 999px;
  vertical-align: middle;
  text-decoration: none;
  line-height: 1.4;
}

.desp-reg-tag--inactive {
  background: rgba(148, 163, 184, 0.22);
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.55);
}

.desp-card-readonly {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.12);
  border: 1.5px dashed rgba(148, 163, 184, 0.5);
  border-radius: 10px;
  letter-spacing: 0.2px;
  cursor: help;
}

.desp-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.desp-list-empty-icon {
  font-size: 40px;
  opacity: 0.7;
}

.desp-list-empty .page-placeholder {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Responsivo */
@media (max-width: 768px) {
  .desp-summary {
    padding: 20px 18px;
  }

  .desp-summary-kpis {
    grid-template-columns: 1fr;
  }

  .desp-summary-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .poup-manut-summary-actions {
    align-items: flex-start;
  }

  .poup-fundo-config {
    flex-direction: column;
    align-items: flex-start;
  }

  .poup-fundo-config__control {
    width: 100%;
    justify-content: flex-start;
  }

  .poup-fundo-config__select {
    max-width: none;
  }

  .poup-geral-composition-body {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .poup-geral-chart-wrapper {
    order: -1;
  }

  .poup-geral-chart-box,
  .poup-geral-chart-empty {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }

  .desp-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .desp-filters {
    justify-content: flex-start;
  }

  .desp-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
  }

  .desp-card-side {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .desp-card-actions {
    flex: 1;
    justify-content: flex-end;
  }

  .desp-ext-list .desp-card-actions {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .desp-list .desp-card-actions .projeto-edit-btn {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .desp-kpi-value {
    font-size: 20px;
  }

  .desp-ext-total-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .desp-ext-total-side {
    align-items: flex-start;
  }
}

/* ========== KPI Cards Premium (ResumoGrafico) ========== */
.kpi-section {
  margin-bottom: 28px;
}

.kpi-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #6B6E6A;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.kpi-section-title-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: #1D9E75;
  flex-shrink: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

.kpi-card {
  background: #FFFFFF;
  border: 1px solid #F0F2EF;
  border-radius: 14px;
  padding: 20px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 18, 0.02);
  min-height: 168px;
}

.kpi-card:hover {
  border-color: #B8BCB7;
  transform: translateY(-1px);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi-card-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6B6E6A;
  line-height: 1.3;
}

.kpi-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-card-icon i,
.kpi-card-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.kpi-card-icon--essencial { background: #EFF9F5; color: #1A6B50; }
.kpi-card-icon--pessoal { background: #E6F1FB; color: #185FA5; }
.kpi-card-icon--total { background: #EFF9F5; color: #144D3A; }
.kpi-card-icon--extraordinario { background: #F0F2EF; color: #6B6E6A; }
.kpi-card-icon--emergencia { background: #FAEEDA; color: #BA7517; }
.kpi-card-icon--projetos { background: #FAECE7; color: #993C1D; }
.kpi-card-icon--poupanca { background: #EAF7EF; color: #1D9E75; }

.kpi-card-value {
  font-family: 'Syne', 'Outfit', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1A1D1A;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0 8px;
  line-height: 1;
}

.kpi-currency {
  font-size: 14px;
  font-weight: 400;
  color: #6B6E6A;
  letter-spacing: 0;
}

.kpi-amount {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.kpi-cents {
  font-size: 15px;
  font-weight: 400;
  color: #6B6E6A;
  letter-spacing: 0;
}

.kpi-card-graph {
  margin: 2px 0 4px;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-card-graph--extra {
  gap: 8px;
  margin-top: 6px;
}

.kpi-extra-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-extra-meta-value {
  font-size: 18px;
  font-weight: 700;
  color: #2A2D2A;
  letter-spacing: -0.3px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-sparkline {
  width: 100%;
  height: 36px;
  display: block;
}

.kpi-sparkline polyline {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
}

.kpi-sparkline[data-spark="essencial"] polyline { stroke: #1D9E75; }
.kpi-sparkline[data-spark="pessoal"] polyline { stroke: #185FA5; }
.kpi-sparkline--dashed line {
  stroke: #B8BCB7;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  stroke-linecap: round;
  opacity: 0.7;
}

.kpi-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #6B6E6A;
  margin-bottom: 6px;
}

.kpi-progress-labels strong {
  font-weight: 600;
  color: #2A2D2A;
}

.kpi-progress-bar {
  height: 4px;
  background: #F0F2EF;
  border-radius: 4px;
  overflow: hidden;
}

.kpi-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.kpi-progress-fill--total { background: #1D9E75; }
.kpi-progress-fill--reserva { background: #BA7517; }
.kpi-progress-fill--essencial { background: #0f766e; }
.kpi-progress-fill--pessoal { background: #0f766e; }

.kpi-progress-label-single {
  font-size: 12px;
  color: #6B6E6A;
  margin-bottom: 6px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.kpi-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 8px;
}

.kpi-card-footer--center {
  justify-content: center;
  text-align: center;
}

/* Projetos / Poupança: linha meta (projetos ativos | caixinhas) na faixa do gráfico, centralizada */
.kpi-card-graph--kpi-meta-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}

.kpi-card-kpi-meta-line {
  margin: 0;
  padding: 0 10px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #6B6E6A;
  line-height: 1.35;
}

.kpi-card-hint {
  font-size: 12px;
  color: #6B6E6A;
}

.kpi-trend {
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.kpi-trend--up { color: #0F6E56; background: #EFF9F5; }
.kpi-trend--down { color: #993C1D; background: #FAECE7; }
.kpi-trend--neutral { color: #6B6E6A; background: #F0F2EF; }

/* Reset/override dos estilos antigos da seção (que ainda tem .dashboard-kpis no <section>) */
.dashboard-kpis.kpi-section .dashboard-kpi-grid,
.dashboard-kpis.kpi-section .dashboard-kpi-card,
.dashboard-kpis.kpi-section .dashboard-section-title { display: none !important; }

/* ========== Relatório IA ========== */
.dashboard-page.relatorio-ia-page {
  min-height: auto;
}

/* Hero: título à esquerda, duas estatísticas à direita */
.dashboard-page.relatorio-ia-page .dashboard-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.dashboard-page.relatorio-ia-page .dashboard-hero-right {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-left: auto;
}

.dashboard-page.relatorio-ia-page .dashboard-hero-total {
  align-items: center;
  text-align: center;
  min-width: 0;
}

@media (max-width: 900px) {
  .dashboard-page.relatorio-ia-page .dashboard-hero-content {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .dashboard-page.relatorio-ia-page .dashboard-hero-right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    gap: 20px;
  }

  .dashboard-page.relatorio-ia-page .dashboard-hero-total {
    flex: 1;
    align-items: center;
    text-align: center;
  }
}

/* Severidade do card Runway */
.kpi-card--runway-critico {
  border-left: 4px solid var(--danger);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.07) 0%, #FFFFFF 45%);
}

.kpi-card--runway-atencao {
  border-left: 4px solid var(--warning);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, #FFFFFF 45%);
}

.kpi-card--runway-saudavel {
  border-left: 4px solid var(--primary);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06) 0%, #FFFFFF 45%);
}

.kpi-card-icon--runway-critico {
  background: #FEE2E2;
  color: #DC2626;
}

.kpi-card-icon--runway-atencao {
  background: #FAEEDA;
  color: #BA7517;
}

.kpi-card-icon--runway-saudavel {
  background: #EFF9F5;
  color: #1A6B50;
}

.kpi-extra-meta-value--critico {
  color: #DC2626;
  font-weight: 800;
}

.kpi-extra-meta-value--atencao {
  color: #BA7517;
  font-weight: 700;
}

.kpi-extra-meta-value--saudavel {
  color: #1A6B50;
  font-weight: 700;
}

.relatorio-ia-page:not(.dashboard-page) {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.maintenance-card {
  width: min(100%, 560px);
  padding: 42px 40px;
  border-radius: 22px;
  background: #FFFFFF;
  border: 1px solid #F0F2EF;
  box-shadow: 0 24px 60px -28px rgba(15, 23, 18, 0.28);
  text-align: center;
}

.maintenance-icon-wrap {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(29, 158, 117, 0.16));
  color: var(--primary);
}

.maintenance-icon {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.maintenance-eyebrow {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6B6E6A;
}

.maintenance-title {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.15;
  color: #1A1D1A;
}

.maintenance-text {
  margin: 0 auto 24px;
  max-width: 440px;
  font-size: 15px;
  line-height: 1.6;
  color: #6B6E6A;
}

.maintenance-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.maintenance-action:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.dashboard-page.relatorio-ia-page .relatorio-ia-runway-grid {
  grid-template-columns: 1fr;
}

.relatorio-ia-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: -12px 0 24px;
  padding: 0 4px;
}

.relatorio-ia-meta-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.relatorio-ia-meta-bar .btn-add {
  flex-shrink: 0;
}

.relatorio-ia-sections {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 36px;
}

.relatorio-ia-empty {
  margin-top: 8px;
}

.relatorio-ia-empty-card {
  margin: 0;
}

.relatorio-ia-table-wrap {
  overflow-x: auto;
  margin-top: 4px;
}

.relatorio-ia-table td,
.relatorio-ia-table th {
  white-space: nowrap;
}

.relatorio-ia-table td:first-child,
.relatorio-ia-table th:first-child {
  white-space: normal;
  min-width: 140px;
}

.relatorio-ia-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.relatorio-ia-badge--essencial {
  background: rgba(15, 118, 110, 0.12);
  color: #0F766E;
}

.relatorio-ia-badge--pessoal {
  background: rgba(99, 102, 241, 0.12);
  color: #4F46E5;
}

.relatorio-ia-valor-alerta {
  font-weight: 700;
  color: #B45309;
}

.relatorio-ia-cta {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s ease;
}

.relatorio-ia-cta:hover {
  background: rgba(15, 118, 110, 0.18);
  color: var(--primary-dark);
}

/* ========== Simulador de Investimentos ========== */
.dashboard-page.simulador-investimento-page {
  min-height: auto;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.dashboard-page.simulador-investimento-page .dashboard-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.dashboard-page.simulador-investimento-page .dashboard-hero-right {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-left: auto;
}

.simulador-card {
  margin-bottom: 28px;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.simulador-premissas-grid,
.simulador-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 20px;
  margin-top: 18px;
}

.simulador-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.simulador-field input,
.simulador-field select {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: var(--transition);
  box-sizing: border-box;
  background-color: #fff;
  color: var(--text-primary);
}

.simulador-field select {
  padding-right: 42px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.simulador-field input:focus,
.simulador-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.simulador-input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.simulador-input-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.simulador-fetch-btn {
  flex: 0 0 44px;
  width: 44px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.simulador-fetch-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(15, 118, 110, 0.08);
}

.simulador-fetch-btn:disabled,
.simulador-fetch-btn.is-loading {
  opacity: 0.6;
  cursor: wait;
}

.simulador-fetch-btn svg {
  width: 18px;
  height: 18px;
}

.simulador-field-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.simulador-field-hint--static {
  display: block;
}

.simulador-field-hint--error {
  color: var(--danger);
}

.simulador-help-text {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid rgba(15, 118, 110, 0.12);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.simulador-form-actions {
  margin-top: 22px;
}

.simulador-form-error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.comparativo-wrapper {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  margin-top: 12px;
  -webkit-overflow-scrolling: touch;
}

.comparativo-wrapper table,
.comparativo-wrapper .simulador-comparativo {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.simulador-comparativo .simulador-metrica-th {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f8fafc;
  text-align: left;
  min-width: 180px;
  max-width: 220px;
  white-space: normal;
  box-shadow: 4px 0 8px -6px rgba(15, 23, 42, 0.18);
}

.simulador-comparativo thead .simulador-metrica-th {
  z-index: 3;
  background: #f1f5f9;
}

.simulador-comparativo .simulador-invest-th {
  min-width: 168px;
  max-width: 220px;
  vertical-align: top;
  white-space: normal;
}

.simulador-invest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.simulador-invest-nome {
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
}

.simulador-comparativo td,
.simulador-comparativo th {
  white-space: nowrap;
  vertical-align: middle;
}

.simulador-comparativo td.simulador-col--melhor,
.simulador-comparativo th.simulador-col--melhor {
  background: rgba(15, 118, 110, 0.07);
}

.simulador-comparativo thead th.simulador-col--melhor {
  box-shadow: inset 0 3px 0 0 var(--primary);
}

.simulador-table .simulador-col-destaque,
.simulador-metrica-row--destaque .simulador-col-destaque {
  font-weight: 700;
  color: var(--primary-dark);
}

.simulador-prazo {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.simulador-remove-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

.simulador-remove-btn:hover {
  background: #fecaca;
  transform: scale(1.05);
}

.simulador-cell--erro {
  color: var(--danger);
  font-size: 13px;
  white-space: normal !important;
}

@media (max-width: 900px) {
  .dashboard-page.simulador-investimento-page .dashboard-hero-content {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-page.simulador-investimento-page .dashboard-hero-right {
    margin-left: 0;
  }
}

/* ========== Converse com a EVA ========== */
.converse-eva-page .converse-eva-hero-scope {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.converse-eva-shell {
  display: flex;
  flex-direction: column;
  min-height: min(62vh, 640px);
  max-height: min(70vh, 720px);
  padding: 0;
  overflow: hidden;
}

.converse-eva-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    radial-gradient(ellipse at top left, rgba(20, 184, 166, 0.06), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 40%);
  scroll-behavior: smooth;
}

.converse-eva-msg {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: min(78%, 640px);
  animation: converseEvaIn 0.28s ease-out;
}

.converse-eva-msg--eva {
  max-width: min(92%, 760px);
}

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

.converse-eva-msg--eva {
  align-self: flex-start;
}

.converse-eva-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.converse-eva-msg-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.converse-eva-msg-avatar svg {
  width: 16px;
  height: 16px;
}

.converse-eva-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.converse-eva-msg-bubble p {
  margin: 0 0 0.65em;
}

.converse-eva-msg-bubble p:last-child {
  margin-bottom: 0;
}

.converse-eva-msg-bubble--md > :first-child {
  margin-top: 0;
}

.converse-eva-msg-bubble--md > :last-child {
  margin-bottom: 0;
}

.converse-eva-msg-bubble--md h1,
.converse-eva-msg-bubble--md h2,
.converse-eva-msg-bubble--md h3,
.converse-eva-msg-bubble--md h4 {
  margin: 1em 0 0.45em;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
}

.converse-eva-msg-bubble--md h1 { font-size: 1.2em; }
.converse-eva-msg-bubble--md h2 { font-size: 1.1em; }
.converse-eva-msg-bubble--md h3 { font-size: 1.05em; }
.converse-eva-msg-bubble--md h4 { font-size: 1em; }

.converse-eva-msg-bubble--md strong {
  font-weight: 700;
  color: var(--primary-dark);
}

.converse-eva-msg-bubble--md em {
  font-style: italic;
}

.converse-eva-msg-bubble--md ul,
.converse-eva-msg-bubble--md ol {
  margin: 0.4em 0 0.85em;
  padding-left: 1.35em;
}

.converse-eva-msg-bubble--md li {
  margin: 0.25em 0;
}

.converse-eva-msg-bubble--md li > p {
  margin: 0.2em 0;
}

.converse-eva-msg-bubble--md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1em 0;
}

.converse-eva-msg-bubble--md blockquote {
  margin: 0.7em 0;
  padding: 0.4em 0 0.4em 0.9em;
  border-left: 3px solid var(--primary-light);
  color: var(--text-secondary);
}

.converse-eva-msg-bubble--md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: #f1f5f9;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.converse-eva-msg-bubble--md pre {
  margin: 0.7em 0;
  padding: 10px 12px;
  overflow-x: auto;
  background: #f1f5f9;
  border-radius: 8px;
}

.converse-eva-msg-bubble--md pre code {
  padding: 0;
  background: transparent;
}

.converse-eva-msg-bubble--md {
  overflow-x: auto;
}

.converse-eva-msg-bubble--md table {
  width: 100%;
  min-width: 420px;
  margin: 0.75em 0;
  border-collapse: collapse;
  font-size: 13px;
}

.converse-eva-msg-bubble--md th,
.converse-eva-msg-bubble--md td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.converse-eva-msg-bubble--md th {
  background: #f0fdfa;
  color: var(--primary-dark);
  font-weight: 700;
}

.converse-eva-msg-bubble--md tr:nth-child(even) td {
  background: #f8fafc;
}

.converse-eva-msg--eva .converse-eva-msg-bubble {
  background: #ffffff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}

.converse-eva-msg--user .converse-eva-msg-bubble {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border-bottom-right-radius: 6px;
}

.converse-eva-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 88px;
}

.converse-eva-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: converseEvaDot 1.2s ease-in-out infinite;
}

.converse-eva-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.converse-eva-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.converse-eva-typing-label {
  margin-left: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

@keyframes converseEvaDot {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.converse-eva-disclaimer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 20px;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: 12.5px;
  line-height: 1.45;
  z-index: 2;
}

.converse-eva-disclaimer-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: #d97706;
}

.converse-eva-composer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 20px 18px;
  background: #ffffff;
  border-top: 1px solid var(--border);
}

.converse-eva-input {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 140px;
  resize: none;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-primary);
  background: #f8fafc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.converse-eva-input:focus {
  outline: none;
  border-color: var(--primary-light);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.converse-eva-input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.converse-eva-send {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.converse-eva-send svg {
  width: 16px;
  height: 16px;
}

.converse-eva-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.converse-eva-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

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

@media (max-width: 900px) {
  .converse-eva-shell {
    min-height: 55vh;
    max-height: none;
    height: calc(100vh - 260px);
  }

  .converse-eva-msg {
    max-width: 92%;
  }

  .converse-eva-composer {
    flex-wrap: wrap;
  }

  .converse-eva-send {
    width: 100%;
  }

  .dashboard-page.converse-eva-page .dashboard-hero-content {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-page.converse-eva-page .dashboard-hero-right {
    margin-left: 0;
  }
}

/* ========== Gerenciador de Tickets ========== */

.tickets-page .cfg-desp-lead {
  margin-bottom: 18px;
}

.tickets-summary .desp-summary-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tickets-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tickets-toolbar {
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.tickets-tipo-filter {
  margin-left: auto;
}

.tickets-select {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.tickets-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.ticket-dot--aberto { background: var(--warning); }
.ticket-dot--em_analise { background: #3b82f6; }
.ticket-dot--em_andamento { background: var(--primary); }
.ticket-dot--resolvido { background: var(--success); }
.ticket-dot--fechado { background: var(--text-light); }

.ticket-card-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.ticket-card-link:hover .desp-card-title-text {
  color: var(--primary-dark);
  text-decoration: underline;
}

.ticket-codigo {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.1);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ticket-status-badge--aberto {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.ticket-status-badge--em_analise {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.ticket-status-badge--em_andamento {
  background: rgba(13, 148, 136, 0.12);
  color: var(--primary-dark);
}

.ticket-status-badge--resolvido {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.ticket-status-badge--fechado {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.ticket-card-icon--bug {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.ticket-card-icon--melhoria {
  background: rgba(168, 85, 247, 0.1);
  color: #7c3aed;
}

.ticket-open-btn {
  text-decoration: none;
}

.tickets-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.tickets-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.tickets-page-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.tickets-page-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.tickets-page-info {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.tickets-modal-content {
  max-width: 520px;
  max-height: 92vh;
  overflow: visible;
}

.tickets-modal-content .modal-header {
  padding: 14px 20px;
}

.tickets-modal-content .modal-header h2 {
  font-size: 18px;
}

.tickets-modal-content form {
  padding: 16px 20px 18px;
}

.tickets-modal-content .form-group {
  margin-bottom: 10px;
}

.tickets-modal-content .form-group label {
  margin-bottom: 4px;
  font-size: 13px;
}

.tickets-modal-content .form-group input,
.tickets-modal-content .form-group select {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 14px;
}

.tickets-modal-content .modal-actions {
  margin-top: 10px;
  padding-top: 12px;
}

.tickets-modal-content .modal-actions .btn-cancel,
.tickets-modal-content .modal-actions .btn-save {
  padding: 10px 18px;
  font-size: 14px;
}

.tickets-modal-content #ticketDescricao {
  min-height: 52px !important;
  max-height: 64px;
  height: 56px;
  padding: 8px 12px;
  resize: none;
  font-size: 14px;
  line-height: 1.4;
}

.tickets-modal-content .tickets-form-hint {
  margin: 0 0 8px;
}

.modal-content .form-group textarea,
.ticket-composer textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  resize: vertical;
  min-height: 96px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-content .form-group textarea:focus,
.ticket-composer textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.modal-close {
  background: none;
  border: none;
  padding: 0;
}

.tickets-form-hint {
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

.tickets-form-hint--info {
  color: var(--text-secondary);
  margin-top: 16px;
}

.tickets-back-link {
  display: inline-flex;
  margin-right: 10px;
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

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

.ticket-detail-hero {
  margin-bottom: 16px;
}

.ticket-detail-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.ticket-detail-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 750;
  color: var(--text-primary);
  line-height: 1.25;
}

.ticket-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.ticket-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.ticket-type-pill--bug {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.ticket-type-pill--melhoria {
  background: rgba(168, 85, 247, 0.12);
  color: #6d28d9;
}

.ticket-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.ticket-description {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  white-space: normal;
}

.ticket-detail-body,
.ticket-timeline-block {
  margin-top: 16px;
}

.ticket-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ticket-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.ticket-comment {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.ticket-comment--equipe {
  background: rgba(13, 148, 136, 0.06);
  border-color: rgba(13, 148, 136, 0.2);
}

.ticket-comment-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 16px;
}

.ticket-comment-body {
  flex: 1;
  min-width: 0;
}

.ticket-comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.ticket-comment-meta strong {
  color: var(--text-primary);
}

.ticket-comment-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.12);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
}

.ticket-comment-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
}

.ticket-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticket-composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.ticket-composer-actions .tickets-form-hint {
  margin: 0;
  margin-right: auto;
}

.tickets-empty {
  margin-top: 12px;
}

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

  .tickets-tipo-filter {
    margin-left: 0;
    width: 100%;
  }

  .tickets-select {
    width: 100%;
  }

  .ticket-detail-title {
    font-size: 20px;
  }

  .ticket-composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ticket-composer-actions .btn-save {
    width: 100%;
  }
}
