/* =============================================
   BALANCES MUNICIPALES
============================================= */

#balancesTitle {
  overflow: hidden;
}

.mc-title-drop {
  display: inline-block;
  animation: balTitleBounce 1.3s cubic-bezier(0.28, 0.84, 0.42, 1) both;
}

.mc-title-drop--delay {
  animation-delay: 0.15s;
  margin-left: 0.25em;
}

@keyframes balTitleBounce {
  0%   { transform: translateY(-160%); opacity: 0; }
  45%  { transform: translateY(0);     opacity: 1; }
  60%  { transform: translateY(-16px); }
  75%  { transform: translateY(0); }
  87%  { transform: translateY(-7px); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mc-title-drop {
    animation: none;
  }
}

.bal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-top: var(--space-8);
  border-bottom: 1px solid var(--color-gray-200);
}

.bal-tab {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 2px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-gray-500);
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition);
}

.bal-tab:hover,
.bal-tab:focus-visible {
  color: var(--color-primary-dark);
  outline: none;
}

.bal-tab--active {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.bal-list {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.bal-empty {
  margin-top: var(--space-6);
  color: var(--color-gray-500);
  font-size: var(--text-sm);
}

.bal-item[hidden] {
  display: none;
}

.bal-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  animation: balFadeIn .5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bal-item:nth-child(1) { animation-delay: .04s; }
.bal-item:nth-child(2) { animation-delay: .10s; }
.bal-item:nth-child(3) { animation-delay: .16s; }
.bal-item:nth-child(4) { animation-delay: .22s; }
.bal-item:nth-child(5) { animation-delay: .28s; }

@keyframes balFadeIn {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.bal-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: transparent;
}

.bal-item--nuevo {
  background: linear-gradient(0deg, var(--color-white), var(--color-white)) padding-box,
              linear-gradient(135deg, var(--color-secondary-light), var(--color-primary)) border-box;
  border: 1px solid transparent;
}

.bal-item-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #4fd8f5 0%, #0db6dd 100%);
  box-shadow: 0 6px 14px -4px rgba(13, 182, 221, 0.45);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bal-item-icon svg {
  width: 24px;
  height: 24px;
}

.bal-item-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.bal-item-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-weight: 700;
  color: var(--color-primary-dark);
  font-size: 14px;
}

.bal-item-fecha {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--color-gray-500);
}

.bal-item-fecha svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.bal-item-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: var(--transition);
}

.bal-item-btn svg {
  width: 13px;
  height: 13px;
  transition: var(--transition);
}

.bal-item-btn:hover,
.bal-item-btn:focus-visible {
  background: var(--color-primary-light);
  outline: none;
  box-shadow: var(--shadow-md);
}

.bal-item-btn:hover svg {
  transform: translateX(3px);
}

@media (max-width: 560px) {
  .bal-item {
    flex-wrap: wrap;
  }
  .bal-item-btn {
    width: 100%;
    justify-content: center;
    order: 3;
  }
}
