/* Huddle — Display: card, stat card, badge, status pill, tag, avatar, copy-link field, tabs */

/* ============ Card ============ */
.hds-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.hds-card--pad { padding: var(--space-6); }
.hds-card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}
.hds-card__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text-primary); letter-spacing: var(--tracking-snug); }
.hds-card__body { padding: var(--space-6); }

/* ============ Stat card ============ */
.hds-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: var(--space-5);
  display: flex; flex-direction: column; gap: 10px;
}
.hds-stat__top { display: flex; align-items: center; justify-content: space-between; }
.hds-stat__label { font-size: var(--text-sm); color: var(--text-muted); font-weight: var(--weight-medium); }
.hds-stat__icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  background: var(--primary-tint); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.hds-stat__icon svg { width: 18px; height: 18px; }
.hds-stat__value { font-size: var(--text-2xl); font-weight: var(--weight-bold); color: var(--text-primary); letter-spacing: var(--tracking-tight); line-height: 1.1; }
.hds-stat__delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); font-weight: var(--weight-medium); }
.hds-stat__delta svg { width: 14px; height: 14px; }
.hds-stat__delta--up { color: var(--success); }
.hds-stat__delta--down { color: var(--danger); }
.hds-stat__delta-note { color: var(--text-muted); font-weight: var(--weight-regular); }

/* ============ Badge / Status pill ============ */
.hds-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 18px;
  padding: 1px 9px; border-radius: var(--radius-pill);
  border: 1px solid transparent; white-space: nowrap;
}
.hds-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hds-badge svg { width: 12px; height: 12px; }

.hds-badge--neutral { background: var(--gray-100); color: var(--gray-700); }
.hds-badge--primary { background: var(--primary-tint); color: var(--indigo-700); }
.hds-badge--success { background: var(--success-surface); color: var(--success); }
.hds-badge--danger  { background: var(--danger-surface);  color: var(--danger); }
.hds-badge--warning { background: var(--warning-surface); color: var(--warning); }
.hds-badge--info    { background: var(--info-surface);    color: var(--info); }
/* outlined variant */
.hds-badge--outline { background: var(--bg-card); border-color: var(--border-default); color: var(--text-secondary); }

/* ============ Tag (removable) ============ */
.hds-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  padding: 3px 8px; border-radius: var(--radius-sm);
  background: var(--gray-100); color: var(--text-secondary);
}
.hds-tag__x { display: inline-flex; cursor: pointer; color: var(--text-muted); border-radius: 3px; }
.hds-tag__x:hover { color: var(--text-primary); background: var(--gray-200); }
.hds-tag__x svg { width: 12px; height: 12px; }

/* ============ Avatar ============ */
.hds-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill); background: var(--primary-tint);
  color: var(--indigo-700); font-weight: var(--weight-semibold);
  overflow: hidden; flex: 0 0 auto; position: relative;
}
.hds-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hds-avatar--xs { width: 24px; height: 24px; font-size: 10px; }
.hds-avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.hds-avatar--md { width: 40px; height: 40px; font-size: 14px; }
.hds-avatar--lg { width: 48px; height: 48px; font-size: 16px; }
.hds-avatar__status {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid var(--bg-card); background: var(--success);
}

/* ============ Copy-link field ============ */
.hds-copylink {
  display: inline-flex; align-items: center; width: 100%;
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--bg-card); box-shadow: var(--shadow-xs); overflow: hidden;
}
.hds-copylink__icon { padding-left: 12px; color: var(--text-muted); display: inline-flex; }
.hds-copylink__icon svg { width: 16px; height: 16px; }
.hds-copylink__text {
  flex: 1; min-width: 0; padding: 0 10px; height: 40px; display: flex; align-items: center;
  font-size: var(--text-sm); color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hds-copylink__btn {
  height: 40px; padding: 0 14px; border: none; border-left: 1px solid var(--border-subtle);
  background: var(--bg-card); color: var(--text-link); font-weight: var(--weight-semibold);
  font-size: var(--text-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background-color .12s ease;
}
.hds-copylink__btn:hover { background: var(--gray-50); }
.hds-copylink__btn svg { width: 15px; height: 15px; }
.hds-copylink__btn--done { color: var(--success); }

/* ============ Tabs ============ */
.hds-tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--border-subtle); }
.hds-tab {
  position: relative; appearance: none; background: none; border: none; cursor: pointer;
  padding: 10px 12px; font-family: var(--font-sans); font-size: var(--text-sm);
  font-weight: var(--weight-medium); color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 7px; transition: color .12s ease;
}
.hds-tab svg { width: 16px; height: 16px; }
.hds-tab:hover { color: var(--text-secondary); }
.hds-tab__count {
  font-size: 11px; font-weight: var(--weight-semibold); padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--gray-100); color: var(--text-muted);
}
.hds-tab--active { color: var(--primary); }
.hds-tab--active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--primary); border-radius: 2px 2px 0 0;
}
.hds-tab--active .hds-tab__count { background: var(--primary-tint); color: var(--indigo-700); }
.hds-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
