/* Sub-modules tab: grouped card grid for adding/removing analyses.
   Cards are organised by pipeline stage (Data, Network, Genetics,
   Biomarker modeling, Interpretation, Validation) so the picker reads as
   a map of the analysis, not a flat list. */

.sm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 20px 0;
}

.sm-count-badge {
  display: inline-block;
  background: var(--color-surface-blue);
  color: var(--color-primary-dark);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 14px;
}

.sm-toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9aa2ac;
}
.sm-toolbar-search .form-group {
  margin-bottom: 0;
}
.sm-toolbar-search input {
  border-radius: 16px;
  font-size: 13px;
}

.sm-group-header {
  margin: 22px 0 10px 0;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}
.sm-group-header:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.sm-group-header h4 {
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0 0 2px 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sm-group-blurb {
  color: #8a929c;
  font-size: 12.5px;
  margin: 0;
}

.sm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 6px;
}

.sm-card-wrap {
  min-width: 0;
}

.sm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 16px 16px 52px 16px;
  box-shadow: none;
  transition: border-color 0.15s ease;
}
.sm-card:hover {
  border-color: #C7D7EE;
}
.sm-card.sm-card-active {
  border-color: var(--color-primary);
  background: var(--color-surface-blue);
}

.sm-card-icon {
  font-size: 20px;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.sm-card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.sm-card-title-row h4 {
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}
.badge-section-sm {
  flex-shrink: 0;
  background: var(--color-surface-blue);
  color: var(--color-primary-dark);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.sm-card-desc {
  color: #5b6470;
  font-size: 12.5px;
  line-height: 1.45;
  margin: 6px 0 0 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.sm-toggle-btn {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  border: 1px solid #C7D7EE;
  background: #ffffff;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 6px 0;
  box-shadow: none;
}
.sm-toggle-btn:hover {
  background: var(--color-surface-blue);
}
.sm-card-active .sm-toggle-btn {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}
.sm-card-active .sm-toggle-btn:hover {
  background: var(--color-primary-dark);
}

/* Catalogue cards are grouped by workflow step and carry that step's status.
   A locked card still opens its tab - the line only says what it is waiting for. */
.sm-card { padding-bottom: 76px; }
.sm-card-reason {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 44px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-ink-secondary);
  overflow-wrap: anywhere;
}
.sm-card.sm-state-locked { border-style: dashed; }
.sm-card.sm-state-locked .sm-card-reason { color: var(--color-warning); }
.sm-card.sm-state-done { border-color: var(--color-success); }
.sm-card.sm-state-done .sm-card-reason { color: var(--color-success); font-weight: 600; }
.sm-card.sm-state-stale { border-color: var(--color-warning); }
.sm-card.sm-state-stale .sm-card-reason { color: var(--color-warning); font-weight: 600; }
