/* app.css — supplemental styles for FieldDesk app pages (dashboard, client detail) */

/* App nav override — no landing hero needed */
.app-nav {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.app-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.app-nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.app-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 600;
  font-size: 18px;
}
.app-nav-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--green);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 700;
}
.app-nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}
.app-nav-section {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.app-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-decoration: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover { opacity: 0.88; }
.btn-secondary {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}
.btn-secondary:hover { background: var(--green-light); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--green-light); color: var(--green); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-danger:hover { opacity: 0.85; }

/* Page layout */
.app-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 40px;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.1;
}
.page-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin-top: 4px;
}

/* Client cards grid */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.client-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.15s;
  text-decoration: none;
  color: var(--fg);
}
.client-card:hover {
  box-shadow: 0 8px 32px rgba(26,58,42,0.08);
  border-color: rgba(26,58,42,0.2);
}
.client-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.client-avatar {
  width: 40px;
  height: 40px;
  background: var(--green);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}
.client-info { flex: 1; min-width: 0; }
.client-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-company {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.client-status {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-active { background: var(--green-light); color: var(--green); }
.status-pending { background: var(--amber-light); color: #92690a; }
.status-inactive { background: #f3f4f6; color: var(--muted); }

.client-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
.client-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.client-meta-icon { color: var(--muted); flex-shrink: 0; }
.client-meta-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* Stats row */
.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}
.stat-label { font-size: 13px; color: var(--muted); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  margin-bottom: 10px;
  color: var(--fg);
}
.empty-state p { font-size: 15px; color: var(--muted); margin-bottom: 20px; }

/* Client detail layout */
.client-detail {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}
.client-main { display: flex; flex-direction: column; gap: 24px; }
.client-sidebar { display: flex; flex-direction: column; gap: 24px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
}
.card-body { padding: 20px; }

/* Contact info */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
}
.contact-icon {
  width: 32px;
  height: 32px;
  background: var(--green-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  flex-shrink: 0;
  font-size: 14px;
}
.contact-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.contact-value { font-size: 14px; color: var(--fg); word-break: break-all; }

/* Call log */
.call-list { display: flex; flex-direction: column; gap: 12px; }
.call-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--green-light);
  border-radius: 8px;
}
.call-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}
.call-inbound { background: #dbeafe; color: #1d4ed8; }
.call-outbound { background: var(--green-light); color: var(--green); }
.call-info { flex: 1; min-width: 0; }
.call-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.call-outcome {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
}
.outcome-answered { background: var(--green-light); color: var(--green); }
.outcome-voicemail { background: #f3f4f6; color: var(--muted); }
.outcome-no-answer { background: var(--amber-light); color: #92690a; }
.call-notes { font-size: 13px; color: var(--fg); margin-top: 2px; }
.call-time { font-size: 12px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }

/* Estimates table */
.estimate-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.estimate-row:last-child { border-bottom: none; }
.estimate-desc { flex: 1; font-size: 14px; color: var(--fg); }
.estimate-amount { font-size: 14px; font-weight: 600; color: var(--fg); }
.estimate-status {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 12px;
}
.estimate-pending { background: var(--amber-light); color: #92690a; }
.estimate-sent { background: #dbeafe; color: #1d4ed8; }
.estimate-approved { background: var(--green-light); color: var(--green); }
.estimate-rejected { background: #fee2e2; color: #991b1b; }
.estimate-actions { display: flex; gap: 6px; }

/* Form styles */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--fg); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  background: #fff;
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { font-size: 12px; color: #b91c1c; margin-top: 4px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 480px;
  max-width: 90vw;
  overflow: hidden;
}
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--muted); padding: 4px; line-height: 1; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg);
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--green); }

/* Utility */
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-mono { font-family: 'DM Sans', monospace; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* Mobile */
@media (max-width: 768px) {
  .app-nav { padding: 14px 20px; }
  .app-page { padding: 24px 20px; }
  .client-detail { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .client-grid { grid-template-columns: 1fr; }
  .stats-row { flex-direction: column; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}