/* Fatturato quick-entry modal — light, mobile-first bottom sheet.
   Uses the shared brand tokens so it follows white-label theming. */

.fatt-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(var(--rgb-ink), 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.fatt-overlay.is-open { display: flex; }
body.fatt-lock { overflow: hidden; }

.fatt-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-modal);
  padding: 16px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: fattSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes fattSlideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (min-width: 577px) {
  .fatt-overlay { align-items: center; }
  .fatt-sheet { border-radius: var(--radius-lg); max-height: 82vh; }
}

.fatt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.fatt-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-heading);
  margin: 0;
}
.fatt-close {
  border: none;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-round);
  font-size: var(--font-size-base);
  cursor: pointer;
  line-height: 1;
}
.fatt-close:hover { background: var(--color-surface-3); }

.fatt-sub {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0 0 12px;
}

/* Candidate list */
.fatt-list { display: flex; flex-direction: column; gap: 8px; }
.fatt-loading, .fatt-empty {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  padding: 12px 4px;
  text-align: center;
}
.fatt-cand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.fatt-cand:hover { border-color: var(--brand-green); background: var(--brand-green-50); }
.fatt-cand:active { transform: scale(0.99); }
.fatt-cand-main { display: flex; flex-direction: column; min-width: 0; }
.fatt-cand-name { font-weight: 600; color: var(--color-text); }
.fatt-cand-phone { font-size: var(--font-size-caption); color: var(--color-text-muted); }

.fatt-badge {
  flex-shrink: 0;
  font-size: var(--font-size-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
}
.fatt-badge--appt {
  color: var(--brand-green-ink);
  background: var(--brand-green-100);
}

/* Amount step */
.fatt-client {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.fatt-avatar {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-round);
  background: var(--brand-green);
  color: var(--neutral-0); font-weight: 700; font-size: var(--font-size-base);
}
.fatt-client-meta { display: flex; flex-direction: column; min-width: 0; }
.fatt-client-name { font-weight: 700; color: var(--color-text); }
.fatt-client-phone { font-size: var(--font-size-caption); color: var(--color-text-muted); }

.fatt-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}
.fatt-amount-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 4px 14px;
  transition: border-color .15s ease;
}
.fatt-amount-wrap:focus-within { border-color: var(--brand-green); }
.fatt-cur { font-size: var(--font-size-xl); color: var(--color-text-muted); font-weight: 600; }
.fatt-amount {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text);
  padding: 10px 0;
  width: 100%;
}

.fatt-error {
  color: var(--color-danger);
  font-size: var(--font-size-sm);
  margin: 10px 0 0;
}

.fatt-actions { display: flex; gap: 10px; margin-top: 20px; }
.fatt-btn {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, opacity .15s ease;
}
.fatt-btn--ghost {
  flex: 0 0 40%;
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}
.fatt-btn--ghost:hover { background: var(--color-surface-3); }
.fatt-btn--primary { background: var(--brand-action); color: var(--neutral-0); }
.fatt-btn--primary:hover { background: var(--brand-action-hover); }
.fatt-btn--primary:disabled { opacity: 0.6; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .fatt-sheet { animation: none; }
}
