/* ─────────────────────────────────────────────────
   components.css — Reusable UI components
   Cards, modals, tabs, badges, alerts, progress bars,
   opportunity items, hours items, profile elements
   ───────────────────────────────────────────────── */

/* ── LOGO MARK ── */
.logo-mark {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-mark svg { width: 15px; height: 15px; }
.logo-name { font-size: 15px; font-weight: 700; color: var(--text-1); letter-spacing: -0.2px; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text-1); }
.card-body  { padding: 16px 18px; }

/* ── STAT CARDS ── */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.stat-card-label { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; }
.stat-card-val   { font-size: 26px; font-weight: 700; color: var(--text-1); letter-spacing: -0.5px; line-height: 1; }
.stat-card-sub   { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.stat-card-sub span { color: var(--accent); font-weight: 600; }

/* ── TABS ── */
.tabs { display: flex; gap: 2px; padding: 4px; background: var(--bg); border-radius: var(--radius-md); }
.tab {
  padding: 6px 14px; border-radius: 8px; border: none;
  font-size: 12px; font-weight: 600; background: none; color: var(--text-3);
  transition: all 0.15s; cursor: pointer;
}
.tab.active { background: var(--surface); color: var(--text-1); border: 1px solid var(--border); }
.tab-panels .tab-panel  { display: none; }
.tab-panels .tab-panel.active { display: block; }

/* ── FILTER ROW ── */
.filter-row {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.filter-select {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 12px; color: var(--text-1); outline: none;
}
.filter-count { margin-left: auto; font-size: 12px; color: var(--text-3); }

/* ── OPPORTUNITY ITEMS ── */
.opp-list { display: flex; flex-direction: column; gap: 1px; }
.opp-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  transition: background 0.12s; cursor: pointer;
}
.opp-item:last-child { border-bottom: none; }
.opp-item:hover { background: var(--bg); }
.opp-org-mark {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.opp-org-mark svg { width: 16px; height: 16px; }
.mark-amber { background: var(--accent-lt); border: 1px solid #B0C0FF; }
.mark-amber svg { stroke: var(--accent); }
.mark-green { background: var(--sky-lt); border: 1px solid var(--brand-blue-4); }
.mark-green svg { stroke: #0070C0; }
.mark-blue  { background: var(--muted-lt); border: 1px solid var(--border-md); }
.mark-blue  svg { stroke: var(--muted); }
.mark-red   { background: var(--urgent-lt); border: 1px solid #FFBBBB; }
.mark-red   svg { stroke: var(--urgent-bright); }
.opp-info   { flex: 1; min-width: 0; }
.opp-title  { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.opp-org    { font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.opp-meta   { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opp-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-top: 2px; }

/* ── HOURS ITEMS ── */
.hours-list { display: flex; flex-direction: column; gap: 1px; }
.hours-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.hours-item:last-child { border-bottom: none; }
.hours-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hours-dot.pending   { background: var(--accent); }
.hours-dot.confirmed { background: var(--accent); }
.hours-dot.logged    { background: var(--text-3); }
.hours-info  { flex: 1; }
.hours-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
.hours-org   { font-size: 12px; color: var(--text-3); }
.hours-val   { font-size: 14px; font-weight: 700; color: var(--text-1); }
.hours-status { font-size: 11px; font-weight: 600; margin-left: 4px; }
.hours-status.pending   { color: var(--accent); }
.hours-status.confirmed { color: var(--accent); }

/* ── PROGRESS BARS ── */
.xp-bar   { height: 5px; background: var(--border); border-radius: 4px; overflow: hidden; }
.xp-fill  { height: 100%; background: var(--accent); border-radius: 4px; }
.item-progress { margin-top: 4px; }
.item-progress-bar  { height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 3px; }
.item-progress-fill { height: 100%; border-radius: 4px; background: var(--accent); }
.item-progress-fill.low { background: var(--accent); }
.item-progress-meta { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); }

/* ── ALERTS ── */
.alert-list { display: flex; flex-direction: column; gap: 1px; }
.alert-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s;
}
.alert-item:hover { background: var(--bg); }
.alert-item:last-child { border-bottom: none; }
.alert-item.unread { background: var(--accent-lt); }
.alert-pip { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.alert-pip.unread { background: var(--accent); }
.alert-pip.read   { background: var(--border-md); }
.alert-text { font-size: 12px; color: var(--text-2); line-height: 1.5; flex: 1; }
.alert-text strong { color: var(--text-1); font-weight: 600; }
.alert-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ── PROFILE ── */
.profile-section { display: flex; flex-direction: column; gap: 12px; }
.profile-header  { display: flex; align-items: center; gap: 14px; }
.profile-avatar  {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--brand-red-1); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  border: 2px solid var(--brand-red-2);
}
.profile-name  { font-size: 16px; font-weight: 700; color: var(--text-1); }
.profile-role  { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ── BADGES ── */
.badges-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-2);
}
.badge.earned { background: var(--accent-lt); border-color: #B0C0FF; color: var(--accent); }
.badge svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── SKILLS WRAP ── */
.skills-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip  {
  padding: 3px 10px; border-radius: 20px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 11px; color: var(--text-2);
}

/* ── ROLE CHIP ── */
.role-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--urgent-lt); color: var(--brand-red-1);
  border-radius: 20px; padding: 3px 9px; font-size: 11px; font-weight: 600;
}

/* ── XP SECTION ── */
.xp-section { display: flex; flex-direction: column; gap: 5px; }
.xp-label   { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); }
.xp-label strong { color: var(--accent); }

/* ── EMPTY STATE ── */
.empty-state { padding: 32px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty-state svg { width: 32px; height: 32px; stroke: var(--border-md); fill: none; stroke-width: 1.5; margin-bottom: 10px; }

/* ── MODAL SYSTEM ── */
.commit-panel {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(26,25,22,0.45);
  align-items: center; justify-content: center;
}
.commit-panel.open { display: flex; }
.commit-modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 480px; max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--border);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px; border: 1px solid var(--border);
  background: none; display: flex; align-items: center; justify-content: center;
}
.modal-close svg { width: 14px; height: 14px; stroke: var(--text-2); fill: none; stroke-width: 2; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ── NEED SUMMARY (modal) ── */
.need-summary { background: var(--accent-lt); border: 1px solid #B0C0FF; border-radius: var(--radius-md); padding: 12px 14px; }
.need-summary-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.need-summary-org   { font-size: 12px; color: var(--accent); }

/* ── RADIO GROUP ── */
.radio-group { display: flex; flex-direction: column; gap: 6px; }
.radio-opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s;
}
.radio-opt:hover    { border-color: var(--accent); background: var(--accent-lt); }
.radio-opt.selected { border-color: var(--accent); background: var(--accent-lt); }
.radio-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--border-md); flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.radio-opt.selected .radio-dot { border-color: var(--accent); background: var(--accent); }
.radio-opt.selected .radio-dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.radio-label { font-size: 13px; font-weight: 600; color: var(--text-1); }
.radio-sub   { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* ── COMMIT MODAL — MULTI-ITEM CHECKLIST ── */
.item-check-list { display: flex; flex-direction: column; gap: 6px; }
.item-check-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.12s; user-select: none;
}
.item-check-row:hover    { border-color: var(--accent); background: var(--accent-lt); }
.item-check-row.checked  { border-color: var(--accent); background: var(--accent-lt); }
.item-checkbox {
  width: 18px; height: 18px; border-radius: 4px;
  border: 1.5px solid var(--border-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s; background: var(--bg);
}
.item-check-row.checked .item-checkbox { background: var(--accent); border-color: var(--accent); }
.item-checkbox::after {
  content: ''; display: none;
  width: 8px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.item-check-row.checked .item-checkbox::after { display: block; }
.item-check-label { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-1); }
.item-qty-row {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.item-check-row.checked .item-qty-row { opacity: 1; pointer-events: all; }
.item-qty-btn {
  width: 24px; height: 24px; border-radius: 4px;
  border: 1px solid var(--border-md); background: var(--surface);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-1); line-height: 1;
}
.item-qty-btn:hover { border-color: var(--accent); }

/* ── AVAILABILITY GRID ── */
.avail-grid { display: grid; grid-template-columns: 80px repeat(7, 1fr); gap: 2px; font-size: 11px; }
.avail-head { text-align: center; font-weight: 700; color: var(--text-3); padding: 4px 2px; letter-spacing: 0.3px; }
.avail-row-label { font-size: 11px; color: var(--text-3); display: flex; align-items: center; padding-right: 6px; }
.avail-cell {
  height: 28px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--bg); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.avail-cell:hover { border-color: var(--accent); background: var(--accent-lt); }
.avail-cell.on  { background: var(--accent); border-color: var(--accent); }
.avail-cell.on::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.8); }
.avail-note { font-size: 11px; color: var(--text-3); margin-top: 8px; }
.avail-hint { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.avail-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
