/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body { scroll-behavior: smooth; }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #6366f1;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s, box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.btn-primary:hover { background: #4f46e5; box-shadow: 0 4px 16px rgba(99,102,241,0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #6366f1;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  border: 1.5px solid #6366f1;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.1s;
}
.btn-outline:hover { background: #eef2ff; transform: translateY(-1px); }

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(37,211,102,0.25);
}
.btn-whatsapp:hover { background: #1ebe5d; transform: translateY(-1px); }

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #f0f0f5;
  padding: 1.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.stat-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #f0f0f5;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.18s;
}
.stat-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.08); }

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
}

.feature-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #f0f0f5;
  padding: 1.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.09); transform: translateY(-3px); }

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.75rem;
  font-size: 1.1rem;
}

/* ── Form elements ── */
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.6rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.875rem;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.form-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-input::placeholder { color: #c4c9d4; }

/* ── Line item row ── */
.line-item-row {
  display: grid;
  grid-template-columns: 1fr 72px 100px 36px;
  gap: 8px;
  align-items: center;
}

@media (max-width: 640px) {
  .line-item-row {
    grid-template-columns: 1fr 56px 84px 28px;
    gap: 5px;
  }
}

/* ── Magic badge ── */
.magic-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.1s;
  border: none;
}
.magic-badge:hover { opacity: 0.88; transform: scale(1.03); }

/* ── Description field wrapper ── */
.desc-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}
.desc-wrapper input { flex: 1; }

/* ── Hero fake input (preview card) ── */
.label-sm {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fake-input {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.55rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  color: #374151;
  min-height: 2.3rem;
  display: flex;
  align-items: center;
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.15s ease;
}

.modal-box {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  animation: slideUp 0.2s ease;
}

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

/* ── Toast ── */
#toast { animation: fadeIn 0.2s ease; }

/* ── Spinner ── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #eef2ff;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Invoice history row ── */
.invoice-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #f0f0f5;
  border-radius: 0.85rem;
  margin-bottom: 0.6rem;
  transition: box-shadow 0.15s;
}
.invoice-row:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.07); }

.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  text-transform: capitalize;
}
.status-pending { background: #fef3c7; color: #d97706; }
.status-paid    { background: #d1fae5; color: #059669; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }
