/* mAI.Priority shared assets and base brand helpers.
   Typography: Plus Jakarta Sans is the single source of truth, loaded once in
   base.html (and auth.html). The old Manrope @font-face block was dead weight
   (never referenced by --font) and has been removed. */

/* SaaS v1 shared system additions. Most legacy templates still define some
   page-local rules; these classes provide the workflow shell and newer panels. */
.app-nav a[aria-current="page"],
.app-nav a.active {
  background: var(--surface-3);
  color: var(--primary);
}

.user-email {
  color: var(--gray-dark);
  font-size: 12px;
  margin-left: 8px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-form {
  margin-left: 6px;
}

.btn-sm {
  font-size: 12px;
  padding: 7px 12px;
}

.page-kicker {
  color: var(--gray-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.page-title-row {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 8px 0 16px;
}

.page-title-row h2 {
  margin: 0;
}

.health-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.health-card {
  background: var(--surface);
  border: 1px solid var(--gray);
  border-radius: 8px;
  padding: 14px;
}

.health-card strong {
  color: var(--primary);
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

.health-card span {
  color: var(--gray-dark);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.health-card small {
  color: var(--text2);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.filter-row {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-row .field {
  margin-bottom: 0;
  min-width: 150px;
}

.workflow-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  overflow-x: auto;
}

.workflow-tabs button,
.workflow-tabs a {
  background: var(--surface);
  border: 1px solid var(--gray);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.workflow-tabs button.active,
.workflow-tabs a.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.next-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.next-action {
  background: var(--surface);
  border: 1px solid var(--gray);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 10px 12px;
}

.export-checklist {
  background: var(--surface2);
  border: 1px solid var(--gray);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
}

.export-checklist div {
  color: var(--text2);
  font-size: 12px;
}

.export-checklist .warn {
  color: var(--red);
}

.export-preview {
  background: var(--surface);
  border: 1px solid var(--gray);
  border-radius: 8px;
  color: var(--text2);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 10px;
  max-height: 130px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.ai-dashboard {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
}

.ai-thread-list {
  display: grid;
  gap: 8px;
}

.ai-thread-item {
  background: var(--surface);
  border: 1px solid var(--gray);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 12px;
  text-align: left;
}

.ai-thread-item:hover {
  border-color: var(--primary-light);
}

.ai-thread-item small {
  color: var(--text2);
  display: block;
  margin-top: 4px;
}

.ai-message-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
}

.ai-message {
  border: 1px solid var(--gray);
  border-radius: 8px;
  padding: 12px;
}

.ai-message strong {
  color: var(--primary);
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  text-transform: capitalize;
}

@media (max-width: 900px) {
  .ai-dashboard,
  .page-title-row {
    grid-template-columns: 1fr;
  }

  .page-title-row {
    align-items: stretch;
    flex-direction: column;
  }
}
