/* ============================================
   Quest2Offer — B2B Layout, Tabs, Table, Badges
   ============================================ */

/* ── Page container ──────────────────────────── */
.biz-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 0 64px;
}

/* ── Header: org name + seats ────────────────── */
.biz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.biz-header > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.biz-header__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.biz-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Seats pill ──────────────────────────────── */
.biz-seats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.biz-seats--warning {
  background: rgba(234, 88, 12, 0.1);
  color: var(--orange);
  border-color: rgba(234, 88, 12, 0.2);
}

.biz-seats--full {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .biz-seats--warning { background: rgba(249, 115, 22, 0.15); }
[data-theme="dark"] .biz-seats--full { background: rgba(239, 68, 68, 0.15); }

/* ── Org switcher ────────────────────────────── */
.biz-org-switcher { position: relative; display: inline-block; }

.biz-org-switcher__trigger {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-xs);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: border-color 0.15s;
}
.biz-org-switcher__trigger:hover { border-color: var(--border-hover); }
.biz-org-switcher__trigger svg { width: 12px; height: 12px; opacity: 0.5; transition: transform 0.2s; }
.biz-org-switcher.is-open .biz-org-switcher__trigger svg { transform: rotate(180deg); }

.biz-org-switcher__dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 200px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xs); box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100; padding: 4px;
}
.biz-org-switcher.is-open .biz-org-switcher__dropdown { display: block; }

.biz-org-switcher__option {
  display: block; padding: 8px 12px; font-size: 14px; color: var(--text);
  border-radius: var(--radius-xs); cursor: pointer; border: none;
  background: none; width: 100%; text-align: left;
}
.biz-org-switcher__option:hover { background: var(--surface-2); }
.biz-org-switcher__option.is-active { color: var(--accent); font-weight: 600; }

/* ── Tabs ────────────────────────────────────── */
.biz-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.biz-tabs::-webkit-scrollbar { height: 3px; }
.biz-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.biz-tabs__tab {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.biz-tabs__tab:hover { color: var(--text); }
.biz-tabs__tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Table (team/invitations) ────────────────── */
.biz-table { width: 100%; border-collapse: collapse; }

.biz-table__header {
  display: grid; grid-template-columns: 1fr 120px 120px;
  padding: 8px 16px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}

.biz-table__row {
  display: grid; grid-template-columns: 1fr 120px 120px;
  align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--border); transition: background 0.1s;
}
.biz-table__row:hover { background: var(--surface-2); }
.biz-table__row:last-child { border-bottom: none; }

.biz-table__cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.biz-table__cell--name { flex-direction: column; align-items: flex-start; gap: 2px; }
.biz-table__name { font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.biz-table__email { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.biz-table__cell--actions { justify-content: flex-end; gap: 4px; }

/* ── Badges ──────────────────────────────────── */
.biz-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.biz-badge--owner { background: rgba(99, 102, 241, 0.12); color: var(--accent); }
.biz-badge--admin { background: rgba(168, 85, 247, 0.12); color: var(--accent-2); }
.biz-badge--member { background: var(--surface-2); color: var(--text-secondary); }
.biz-badge--pending { background: rgba(234, 88, 12, 0.1); color: var(--orange); }
.biz-badge--accepted { background: rgba(22, 163, 74, 0.1); color: var(--green); }
.biz-badge--declined, .biz-badge--revoked { background: var(--surface-2); color: var(--text-muted); }
.biz-badge--expired { background: rgba(239, 68, 68, 0.08); color: #ef4444; }

[data-theme="dark"] .biz-badge--owner { background: rgba(99, 102, 241, 0.2); }
[data-theme="dark"] .biz-badge--admin { background: rgba(168, 85, 247, 0.2); }
[data-theme="dark"] .biz-badge--pending { background: rgba(249, 115, 22, 0.15); }
[data-theme="dark"] .biz-badge--accepted { background: rgba(34, 197, 94, 0.15); }
[data-theme="dark"] .biz-badge--expired { background: rgba(239, 68, 68, 0.12); }

/* ── Buttons ─────────────────────────────────── */
.biz-btn {
  padding: 4px 10px; font-size: 12px; font-weight: 500;
  border-radius: var(--radius-xs); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.biz-btn:hover { background: var(--surface-2); border-color: var(--border-hover); color: var(--text); }
.biz-btn--danger { color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }
.biz-btn--danger:hover { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.4); color: #dc2626; }
.biz-btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.biz-btn--primary:hover { background: var(--accent-light); border-color: var(--accent-light); }
.biz-btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Role select ─────────────────────────────── */
.biz-role-select { padding: 4px 8px; font-size: 12px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }

/* ── Invite form ─────────────────────────────── */
.biz-invite-form { display: flex; gap: 8px; margin-bottom: 24px; margin-top: 24px; padding: 16px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.biz-invite-form__input { flex: 1; padding: 8px 14px; font-size: 14px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface); color: var(--text); outline: none; transition: border-color 0.15s; }
.biz-invite-form__input:focus { border-color: var(--accent); }
.biz-invite-form__input::placeholder { color: var(--text-muted); }

/* ── Empty state ─────────────────────────────── */
.biz-empty { text-align: center; padding: 48px 24px; }
.biz-empty__icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.biz-empty__title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.biz-empty__subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* ── Pending banner ──────────────────────────── */
.biz-pending-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; background: rgba(234, 88, 12, 0.06); border: 1px solid rgba(234, 88, 12, 0.15); border-radius: var(--radius-sm); font-size: 14px; color: var(--text); }
.biz-pending-banner__icon { font-size: 18px; flex-shrink: 0; }
.biz-pending-banner__text { flex: 1; }
[data-theme="dark"] .biz-pending-banner { background: rgba(249, 115, 22, 0.08); border-color: rgba(249, 115, 22, 0.2); }

/* ── Shared: Stat card ──────────────────────────── */
.biz-stat-card {
  padding: 16px;
  border-radius: var(--radius, 16px);
  background: var(--surface, #18181b);
  border: 1px solid var(--border);
}
.biz-stat-card__value { font-size: 24px; font-weight: 800; color: var(--text-primary); }
.biz-stat-card__label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Shared: Data table ─────────────────────────── */
.biz-data-table { width: 100%; border-collapse: collapse; }
.biz-data-table th {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-align: left; padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.biz-data-table td {
  padding: 12px; border-bottom: 1px solid var(--border);
  font-size: 14px; color: var(--text-primary); vertical-align: middle;
}
.biz-data-table tr:hover td { background: var(--bg-subtle); }
.biz-data-table .biz-member-email { font-size: 12px; color: var(--text-muted); }

/* ── Shared: Empty tab state ────────────────────── */
.biz-empty-tab { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.biz-empty-tab__icon { font-size: 40px; margin-bottom: 12px; }
.biz-empty-tab__text { font-size: 15px; }

/* ── Shared: Filter chips ───────────────────────── */
.biz-filter-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.biz-filter-chip {
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface, #18181b); border: 1px solid var(--border);
  cursor: pointer; font-size: 13px; color: var(--text-secondary);
  transition: all 0.2s;
}
.biz-filter-chip:hover { border-color: var(--border-hover); }
.biz-filter-chip.is-active {
  background: var(--accent, #6366f1); color: #fff;
  border-color: var(--accent, #6366f1);
}

/* ── Readiness Tab ──────────────────────────────── */
.biz-readiness-summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-bottom: 24px;
}
.biz-readiness-card {
  padding: 20px; border-radius: var(--radius, 16px);
  background: var(--surface, #18181b); border: 1px solid var(--border);
}
.biz-readiness-card--ready       { border-left: 4px solid var(--green, #22c55e); }
.biz-readiness-card--needs-work  { border-left: 4px solid var(--orange, #f97316); }
.biz-readiness-card--not-assessed { border-left: 4px solid var(--text-muted); }
.biz-readiness-card__value { font-size: 32px; font-weight: 800; color: var(--text-primary); }
.biz-readiness-card__label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* Status badges */
.biz-status-badge {
  display: inline-flex; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.biz-status-badge--ready        { background: rgba(34,197,94,0.12);  color: var(--green, #22c55e); }
.biz-status-badge--needs-work   { background: rgba(249,115,22,0.12); color: var(--orange, #f97316); }
.biz-status-badge--not-assessed { background: rgba(138,138,148,0.12); color: var(--text-muted); }

/* Confidence indicator */
.biz-confidence-low { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* Skill tags */
.biz-skill-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.biz-skill-tag {
  padding: 2px 8px; border-radius: var(--radius-xs, 6px);
  font-size: 11px; font-family: monospace;
}
.biz-skill-tag--gap      { background: rgba(249,115,22,0.10); color: var(--orange, #f97316); }
.biz-skill-tag--strength { background: rgba(34,197,94,0.10);  color: var(--green, #22c55e); }

/* ── Interviews Tab ─────────────────────────────── */
.biz-interviews-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 24px;
}

/* Score badge */
.biz-score-badge {
  display: inline-flex; padding: 4px 10px;
  border-radius: var(--radius-xs, 6px);
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px;
}
.biz-score-badge--high { background: rgba(34,197,94,0.12);  color: var(--green, #22c55e); }
.biz-score-badge--mid  { background: rgba(249,115,22,0.12); color: var(--orange, #f97316); }
.biz-score-badge--low  { background: rgba(239,68,68,0.12);  color: #ef4444; }

/* ── Reports Tab ────────────────────────────────── */
.biz-reports-section { margin-bottom: 32px; }
.biz-reports-section__title {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary); margin: 0 0 14px;
}

/* Skill gap bars */
.biz-gap-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.biz-gap-label {
  min-width: 160px; font-family: monospace;
  font-size: 13px; color: var(--text-secondary);
}
.biz-gap-track {
  flex: 1; height: 8px;
  background: var(--surface, #18181b); border-radius: 4px; overflow: hidden;
}
.biz-gap-fill {
  height: 100%; background: var(--orange, #f97316);
  border-radius: 4px; transition: width 0.3s ease;
}
.biz-gap-count { min-width: 50px; text-align: right; font-size: 13px; color: var(--text-muted); }

/* Top performers */
.biz-top-performers { display: flex; flex-direction: column; gap: 8px; }
.biz-top-row {
  display: grid; grid-template-columns: 32px 1fr auto auto auto;
  gap: 12px; align-items: center; padding: 10px 12px;
  border-radius: var(--radius-sm, 10px); background: var(--surface, #18181b);
}
.biz-top-rank { font-size: 16px; font-weight: 800; color: var(--accent, #6366f1); text-align: center; }
.biz-top-name { font-weight: 600; color: var(--text-primary); }
.biz-top-stat { font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* Monthly activity */
.biz-monthly-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .biz-page { padding: 20px 0 48px; }
  .biz-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }
  .biz-header__actions { width: 100%; }
  .biz-seats { font-size: 12px; padding: 5px 12px; }
  .biz-tabs { margin-bottom: 16px; }
  .biz-tabs__tab { padding: 10px 14px; }
  .biz-table__header { grid-template-columns: 1fr 90px 80px; padding: 8px 12px; font-size: 11px; }
  .biz-table__row { grid-template-columns: 1fr 90px 80px; padding: 10px 12px; }
  .biz-invite-form { flex-direction: column; }
  .biz-readiness-summary { grid-template-columns: 1fr; }
  .biz-interviews-stats { grid-template-columns: repeat(2, 1fr); }
  .biz-monthly-stats { grid-template-columns: 1fr; }
  .biz-top-row { grid-template-columns: 32px 1fr auto; }
  .biz-top-row .biz-top-stat:nth-child(n+4) { display: none; }
  .biz-gap-label { min-width: 100px; }
  .biz-data-table { font-size: 13px; }
  .biz-data-table th, .biz-data-table td { padding: 8px; }
}

@media (max-width: 480px) {
  .biz-header__title { font-size: 19px; line-height: 1.25; }
  .biz-table__header { grid-template-columns: 1fr 70px; }
  .biz-table__row { grid-template-columns: 1fr 70px; }
  .biz-table__cell--role { display: none; }
  .biz-tabs__tab { padding: 9px 12px; font-size: 13px; }
  .biz-interviews-stats { grid-template-columns: 1fr; }
  .biz-filter-bar { flex-wrap: wrap; }
}
