/* AmplySales App Styles - matches landing page design system */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #0a0a0a;
  --paper: #fafaf9;
  --accent: #e85d2a;
  --accent-hover: #d14d1e;
  --accent-soft: #fff0ea;
  --grey-100: #f5f5f4;
  --grey-200: #e7e5e4;
  --grey-400: #a8a29e;
  --grey-600: #57534e;
  --grey-800: #292524;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #ca8a04;
  --warning-soft: #fefce8;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 12px;
  --radius-lg: 16px;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.15;
}

/* ---- APP NAV ---- */
.app-nav {
  background: white;
  border-bottom: 1px solid var(--grey-200);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.app-nav .logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--grey-600);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s;
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--grey-100);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user .user-name {
  font-size: 0.85rem;
  color: var(--grey-600);
  font-weight: 500;
}

.btn-logout {
  font-size: 0.8rem;
  color: var(--grey-400);
  background: none;
  border: 1px solid var(--grey-200);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ---- APP LAYOUT ---- */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--grey-600);
  font-size: 1rem;
}

/* ---- CARDS ---- */
.card {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-400);
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.stat-card .stat-value.accent { color: var(--accent); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--grey-200);
}

.btn-secondary:hover {
  border-color: var(--grey-400);
}

.btn-ghost {
  background: transparent;
  color: var(--grey-600);
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--grey-100);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ---- FORMS ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--grey-800);
  margin-bottom: 0.4rem;
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--grey-400);
  margin-top: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a8a29e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  text-transform: capitalize;
}

.badge-new { background: var(--accent-soft); color: var(--accent); }
.badge-emailed { background: #eff6ff; color: #2563eb; }
.badge-replied { background: var(--success-soft); color: var(--success); }
.badge-booked { background: #f5f3ff; color: #7c3aed; }
.badge-passed { background: var(--grey-100); color: var(--grey-600); }
.badge-draft { background: var(--warning-soft); color: var(--warning); }
.badge-approved { background: var(--success-soft); color: var(--success); }
.badge-sent { background: #eff6ff; color: #2563eb; }

/* ---- TABLES ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-400);
  border-bottom: 1px solid var(--grey-200);
}

.data-table td {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--grey-100);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--grey-100);
}

.data-table .actions {
  display: flex;
  gap: 0.5rem;
}

/* ---- PROSPECT CARDS ---- */
.prospect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.prospect-card {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.15s;
}

.prospect-card:hover {
  border-color: var(--accent);
}

.prospect-card .company-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.prospect-card .contact-info {
  font-size: 0.9rem;
  color: var(--grey-600);
  margin-bottom: 0.75rem;
}

.prospect-card .detail-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--grey-600);
  margin-bottom: 0.35rem;
}

.prospect-card .detail-row .label {
  font-weight: 600;
  color: var(--grey-800);
  min-width: 70px;
}

.prospect-card .research {
  font-size: 0.85rem;
  color: var(--grey-600);
  line-height: 1.5;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--grey-100);
}

.prospect-card .card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--grey-100);
}

/* ---- EMAIL PREVIEW ---- */
.email-preview {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.email-preview .email-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--grey-100);
  background: var(--grey-100);
}

.email-preview .email-subject {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.email-preview .email-to {
  font-size: 0.85rem;
  color: var(--grey-600);
  margin-top: 0.25rem;
}

.email-preview .email-body {
  padding: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.email-preview .email-actions {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--grey-100);
  display: flex;
  gap: 0.75rem;
}

/* ---- MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--grey-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--grey-400);
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-body {
  padding: 1.5rem;
}

/* ---- ICP CARDS ---- */
.icp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.icp-card {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.15s;
}

.icp-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(232, 93, 42, 0.08);
}

.icp-card .icp-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.icp-card .icp-detail {
  font-size: 0.85rem;
  color: var(--grey-600);
  margin-bottom: 0.35rem;
  display: flex;
  gap: 0.5rem;
}

.icp-card .icp-detail strong {
  color: var(--grey-800);
  min-width: 80px;
}

.icp-card .icp-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--grey-100);
  display: flex;
  gap: 0.5rem;
}

/* ---- EMPTY STATES ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--grey-600);
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* ---- LOADING ---- */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--grey-200);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem;
  color: var(--grey-600);
}

/* ---- TOAST ---- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

.toast-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.toast-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- AUTH PAGE ---- */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-card .auth-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-card .auth-logo span { color: var(--accent); }

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--grey-600);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.auth-card .auth-toggle {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--grey-600);
}

.auth-card .auth-toggle a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-card .auth-toggle a:hover {
  text-decoration: underline;
}

.auth-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 0.75rem;
  font-size: 1rem;
}

.auth-error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

/* ---- QUICK ACTIONS ---- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s;
}

.quick-action:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(232, 93, 42, 0.08);
}

.quick-action .qa-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.quick-action .qa-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.quick-action .qa-text p {
  font-size: 0.8rem;
  color: var(--grey-600);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .app-container { padding: 1.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .prospect-grid { grid-template-columns: 1fr; }
  .icp-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .quick-actions { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 1.5rem; }
}
