/* ===== Общие элементы интерфейса ===== */

.card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-4);
}

.card__label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}

.card__title { font-size: 17px; margin-bottom: var(--sp-2); }

.card--total {
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-4);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.85), rgba(239, 232, 251, 0.72)),
    var(--surface);
  box-shadow: var(--shadow-lg);
}

.total__amount {
  font-size: clamp(34px, 11vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: var(--sp-1) 0 var(--sp-3);
  color: var(--graphite);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.75);
  color: var(--graphite-2);
  box-shadow: var(--shadow-sm);
}

.badge--pos { background: var(--mint); color: var(--mint-800); }
.badge--neg { background: var(--danger-bg); color: var(--danger); }
.badge--neutral { background: var(--lav-100); color: var(--graphite-2); }

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.72);
  color: var(--graphite);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.btn:active { transform: translateY(1px) scale(0.985); box-shadow: var(--shadow-sm); }

.btn--primary {
  background: linear-gradient(160deg, #efe8fb, #ddd0f3 55%, #d3c3ef);
  color: var(--lav-800);
  box-shadow: 0 12px 24px rgba(125, 106, 201, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.8);
}

.btn--ghost { background: rgba(255, 255, 255, 0.55); color: var(--graphite-2); }

.btn--danger-ghost {
  background: var(--danger-bg);
  color: var(--danger);
  box-shadow: none;
}

.btn--icon {
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
}

.btn--full { width: 100%; }

.icon { width: 22px; height: 22px; display: inline-block; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 18px; height: 18px; opacity: 0.5; }

/* Формы */
.form { display: flex; flex-direction: column; gap: var(--sp-4); }

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

.field__label { font-size: 14px; font-weight: 600; color: var(--graphite-2); }

.field__input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 2px rgba(76, 60, 110, 0.05);
  font-size: 17px;
  appearance: none;
}

.field__input:focus {
  outline: 2px solid var(--lav-400);
  outline-offset: 1px;
  border-color: transparent;
}

.field__input--compact { min-height: 46px; font-size: 15px; }

.field__error { font-size: 13.5px; color: var(--danger); }

.field__hint { font-size: 13px; color: var(--muted); }

/* Нижняя навигация */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 2px;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: rgba(255, 253, 250, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(80, 65, 100, 0.08);
  box-shadow: 0 -8px 24px rgba(76, 60, 110, 0.08);
  max-width: 560px;
  margin: 0 auto;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  min-height: 52px;
  border-radius: var(--r-md);
  color: var(--muted);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item.is-active { color: var(--lav-600); }
.bottom-nav__item.is-active .icon { transform: translateY(-1px); }
.bottom-nav__label { white-space: nowrap; }

.fab {
  position: fixed;
  right: max(16px, calc(50% - 280px + 16px));
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  z-index: 31;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(160deg, #efe8fb, #d3c3ef);
  color: var(--lav-800);
  box-shadow: 0 14px 28px rgba(125, 106, 201, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.fab .icon { width: 26px; height: 26px; }
.fab:active { transform: scale(0.94); }

/* Тосты и диалоги */
.toast-layer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 84px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: rgba(50, 46, 55, 0.94);
  color: #fff;
  font-size: 14.5px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fade-up 0.25s ease;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(44, 38, 56, 0.42);
  backdrop-filter: blur(3px);
  padding: 16px;
}

.modal {
  width: min(100%, 420px);
  background: var(--surface-solid);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.22s ease;
}

.modal__title { font-size: 19px; margin-bottom: var(--sp-2); }
.modal__text { color: var(--graphite-2); font-size: 15px; margin-bottom: var(--sp-4); }
.modal__actions { display: flex; flex-direction: column; gap: 10px; }
