* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #1a1a2e;
}
.topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 24px;
  background: #1a1a2e;
  color: white;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar-user { margin-left: auto; color: #9aa0c0; font-size: 13px; }
.logout-btn {
  margin-left: 12px;
  padding: 6px 12px;
  border: 1px solid #3a3d5c;
  border-radius: 6px;
  background: transparent;
  color: white;
  font-size: 13px;
  cursor: pointer;
}
.logout-btn:hover { background: #2a2d4a; }

.auth-screen {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: white;
  border-radius: 10px;
  padding: 28px 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.auth-card h2 { margin: 0 0 4px; font-size: 18px; }
.auth-tagline { margin: 0 0 16px; color: #6b7086; font-size: 13px; }
.auth-domain { margin-top: 16px; font-size: 12px; text-align: center; }
.auth-card label {
  display: block;
  font-size: 13px;
  color: #6b7086;
  margin: 12px 0 6px;
}
.auth-card label:first-of-type { margin-top: 0; }
.auth-card input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid #d7d9e3;
  border-radius: 6px;
}
.auth-actions { margin-top: 18px; display: flex; gap: 10px; }
.auth-actions button {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: #4338ca;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.auth-actions button.auth-secondary { background: white; color: #4338ca; border: 1px solid #4338ca; }
#auth-status { margin-top: 12px; font-size: 13px; }

.layout { display: flex; min-height: calc(100vh - 56px); }

.sidebar {
  width: 220px;
  background: white;
  border-right: 1px solid #e2e4ea;
  padding: 16px;
}
.sidebar h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a8fa3;
  margin: 0 0 8px;
}
#business-list { list-style: none; margin: 0; padding: 0; }
.business-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #1a1a2e;
}
.business-item:hover { background: #f0f1f6; }
.business-item.active { background: #4338ca; color: white; }
.business-item .crm-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  background: #cbd0dd;
}
.business-item.active .crm-dot.connected { background: #4ade80; }
.business-item .crm-dot.connected { background: #16a34a; }

.content { flex: 1; padding: 24px 32px; }
.empty-state { color: #8a8fa3; }

.content { display: flex; flex-direction: column; gap: 20px; }

.summary-card {
  background: white;
  border-radius: 10px;
  padding: 20px 24px;
  max-width: 720px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.summary-card h2 { margin-top: 0; }
.brand-brain dl { grid-template-columns: 160px 1fr; }
.brand-brain dd { line-height: 1.5; }
.brand-brain h2 { display: flex; align-items: center; gap: 10px; }
.edit-profile-btn {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid #d7d9e3;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-weight: normal;
}
.profile-form h3 { margin: 18px 0 10px; font-size: 13px; color: #4338ca; }
.profile-form h3:first-child { margin-top: 0; }
.muted { color: #b2b6c4; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.connected { background: #dcfce7; color: #166534; }
.badge.disconnected { background: #f1f2f6; color: #6b7086; }
dl { display: grid; grid-template-columns: 160px 1fr; row-gap: 8px; margin: 16px 0; }
dt { color: #6b7086; font-size: 13px; }
dd { margin: 0; font-size: 14px; }
.pipeline { border-top: 1px solid #eceef3; padding-top: 12px; margin-top: 12px; }
.pipeline-stages { color: #6b7086; font-size: 13px; }
.error { color: #b91c1c; }

.director-panel label {
  display: block;
  font-size: 13px;
  color: #6b7086;
  margin-bottom: 6px;
}
.director-panel textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid #d7d9e3;
  border-radius: 6px;
  resize: vertical;
}
.director-panel button {
  margin-top: 12px;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  background: #4338ca;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.director-panel button:disabled { background: #a5a9c9; cursor: default; }
#director-result { margin-top: 16px; }
.strategy-result dl { grid-template-columns: 180px 1fr; }
.strategy-result dd { line-height: 1.5; }
#save-strategy-status { margin-left: 10px; font-size: 13px; color: #6b7086; }

.saved-strategy-item {
  border-top: 1px solid #eceef3;
  padding: 14px 0;
}
.saved-strategy-item:first-child { border-top: none; padding-top: 4px; }
.saved-strategy-header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.saved-strategy-meta { color: #6b7086; font-size: 13px; margin-top: 4px; }
.saved-strategy-actions { margin-top: 10px; display: flex; gap: 8px; }
.saved-strategy-actions button {
  padding: 6px 12px;
  border: 1px solid #d7d9e3;
  border-radius: 6px;
  background: white;
  font-size: 13px;
  cursor: pointer;
}
.saved-strategy-actions button:hover { background: #f0f1f6; }
.saved-strategy-detail { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #eceef3; }
.saved-strategy-detail dl { grid-template-columns: 160px 1fr; margin: 0; }

.badge.status-draft { background: #fef3c7; color: #92400e; }
.badge.status-approved { background: #dcfce7; color: #166534; }
.badge.status-archived { background: #f1f2f6; color: #6b7086; }
.badge.status-scheduled { background: #dbeafe; color: #1e40af; }
.badge.status-cancelled { background: #fee2e2; color: #991b1b; }

#schedule-content-btn {
  padding: 9px 16px;
  border: none;
  border-radius: 6px;
  background: #4338ca;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
}
.calendar-form { margin-bottom: 14px; }

.campaign-builder {
  margin-top: 14px;
  padding: 16px;
  background: #f8f9fc;
  border: 1px solid #e2e4ea;
  border-radius: 8px;
}
.campaign-builder h3 { margin: 0 0 12px; font-size: 14px; }
.campaign-builder label {
  display: block;
  font-size: 12px;
  color: #6b7086;
  margin: 10px 0 4px;
}
.campaign-builder label:first-of-type { margin-top: 0; }
.campaign-builder input,
.campaign-builder select,
.campaign-builder textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid #d7d9e3;
  border-radius: 6px;
  background: white;
}
.campaign-builder-actions { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.campaign-builder-actions button {
  padding: 9px 16px;
  border: none;
  border-radius: 6px;
  background: #4338ca;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.campaign-builder-actions button:disabled { background: #a5a9c9; cursor: default; }

.content-generator {
  margin-top: 14px;
  padding: 16px;
  background: #f8f9fc;
  border: 1px solid #e2e4ea;
  border-radius: 8px;
}
.content-generator h3 { margin: 0 0 12px; font-size: 14px; }
.content-generator label {
  display: block;
  font-size: 12px;
  color: #6b7086;
  margin: 10px 0 4px;
}
.content-generator label:first-of-type { margin-top: 0; }
.content-generator select,
.content-generator textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid #d7d9e3;
  border-radius: 6px;
  background: white;
}
.content-generator-actions { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.content-generator-actions button {
  padding: 9px 16px;
  border: none;
  border-radius: 6px;
  background: #4338ca;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.content-generator-actions button:disabled { background: #a5a9c9; cursor: default; }

.cg-variants { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.content-variant {
  padding: 14px;
  background: white;
  border: 1px solid #e2e4ea;
  border-radius: 8px;
}
.content-variant h4 { margin: 0 0 8px; font-size: 13px; color: #4338ca; }
.content-variant label {
  display: block;
  font-size: 12px;
  color: #6b7086;
  margin: 8px 0 4px;
}
.content-variant label:first-of-type { margin-top: 0; }
.content-variant input[type="text"],
.content-variant textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid #d7d9e3;
  border-radius: 6px;
}
.content-variant-actions { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.content-variant-actions button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: #16a34a;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.content-variant-actions button:disabled { background: #a5a9c9; cursor: default; }

.generated-image-preview {
  display: block;
  max-width: 100%;
  max-height: 480px;
  border-radius: 8px;
  border: 1px solid #e2e4ea;
  margin: 8px 0;
}
.img-again-btn { background: #6b7086; }

.ai-usage-section h3 { font-size: 13px; color: #6b7086; margin: 18px 0 8px; }
.ai-usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ai-usage-table th {
  text-align: left;
  color: #6b7086;
  font-weight: 600;
  border-bottom: 1px solid #e2e4ea;
  padding: 6px 8px;
}
.ai-usage-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f0f1f6;
}

.app-footer {
  padding: 20px 24px 28px;
  text-align: center;
  color: #9aa0c0;
  font-size: 12px;
}
.app-footer p { margin: 2px 0; }
.app-footer a { color: #9aa0c0; }
.app-footer .footer-links { margin-top: 8px; }
.app-footer .footer-links a { margin: 0 6px; }

/* Milestone 15 — minimal, reused across reset-password.html/privacy.html/terms.html */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #4338ca;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}
.legal-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  line-height: 1.6;
}
.legal-page h1 { font-size: 22px; }
.legal-page .legal-notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 12px 16px;
  color: #9a3412;
  font-size: 13px;
  margin-bottom: 24px;
}
.legal-page a { color: #4338ca; }
