/* -----------------------------------------------------------------------------
   IPE Project Control - small custom layer on top of Tailwind.
   Only things Tailwind utilities cannot express cleanly live here.
----------------------------------------------------------------------------- */

/* Keep the sticky save button clear of the iOS home indicator. */
body {
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}

/* Native date inputs render tiny on iOS unless the font size is >= 16px. */
input[type="date"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  font-size: max(16px, 1em);
}

/* Category chips: whole tile is the tap target, at least 44px tall. */
.category-chip {
  display: block;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.category-chip:active span {
  transform: scale(0.98);
}

/* Toasts */
.toast {
  animation: toast-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast--leaving {
  animation: toast-out 160ms ease-in forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-6px); }
}

/* Freshly saved rows flash once so the user sees the capture landed. */
.just-saved {
  animation: just-saved 1.4s ease-out;
}
@keyframes just-saved {
  0%   { background-color: #ecfdf5; border-color: #6ee7b7; }
  100% { background-color: #ffffff; }
}

/* Spinner used by the save button while the request is in flight. */
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 9999px;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print: transaction detail should be printable as a simple voucher. */
@media print {
  header, nav, .no-print { display: none !important; }
  body { background: #fff; }
}
