/* ============================================================
   FERALVOICE OS — COMPONENT LIBRARY
   ============================================================ */

/* ---------- 1. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 36px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--t-base);
  white-space: nowrap;
  user-select: none;
  position: relative;
  letter-spacing: -0.005em;
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 2px 6px var(--fv-violet-glow);
}
.btn-primary:hover { background: var(--gradient-brand-hover); box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 4px 12px var(--fv-violet-glow); }

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.btn-ghost {
  color: var(--text-secondary);
  background: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: rgba(244, 63, 94, 0.12);
  color: var(--fv-rose);
  border-color: rgba(244, 63, 94, 0.2);
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.2); }

.btn-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--fv-emerald);
  border-color: rgba(16, 185, 129, 0.2);
}
.btn-success:hover { background: rgba(16, 185, 129, 0.2); }

.btn-outline {
  background: transparent;
  color: var(--fv-violet-bright);
  border-color: rgba(139, 92, 246, 0.3);
}
.btn-outline:hover { background: rgba(139, 92, 246, 0.08); border-color: var(--fv-violet); }

.btn-sm { height: 28px; padding: 0 var(--space-3); font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { height: 44px; padding: 0 var(--space-6); font-size: 15px; border-radius: var(--radius-lg); }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-icon.btn-lg { width: 44px; }
.btn-block { width: 100%; }

/* ---------- 2. CARDS ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  position: relative;
  transition: border-color var(--t-base), transform var(--t-base);
}
.card-hover:hover { border-color: var(--border); transform: translateY(-1px); }
.card-elevated { box-shadow: var(--shadow-md); border-color: var(--border-subtle); }
.card-pad { padding: var(--space-5); }
.card-pad-sm { padding: var(--space-4); }
.card-pad-lg { padding: var(--space-6); }

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.card-header h3, .card-header h4 { margin: 0; }
.card-body { padding: var(--space-5); }
.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Stat card */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  transition: all var(--t-base);
}
.stat-card:hover { border-color: var(--border); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity var(--t-base);
}
.stat-card:hover::before { opacity: 1; }
.stat-card-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: var(--space-2); color: var(--text-primary); }
.stat-card-meta { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); font-size: 12px; }
.stat-card-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  position: absolute; top: var(--space-5); right: var(--space-5);
}

/* ---------- 3. BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  letter-spacing: 0.01em;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-violet { background: rgba(139, 92, 246, 0.14); color: var(--fv-violet-bright); }
.badge-cyan { background: rgba(6, 182, 212, 0.14); color: var(--fv-cyan); }
.badge-emerald { background: rgba(16, 185, 129, 0.14); color: var(--fv-emerald); }
.badge-amber { background: rgba(245, 158, 11, 0.14); color: var(--fv-amber); }
.badge-rose { background: rgba(244, 63, 94, 0.14); color: var(--fv-rose); }
.badge-blue { background: rgba(59, 130, 246, 0.14); color: var(--fv-blue); }
.badge-pink { background: rgba(236, 72, 153, 0.14); color: var(--fv-pink); }
.badge-neutral { background: var(--bg-elevated); color: var(--text-secondary); }
.badge-lg { padding: 4px 12px; font-size: 12px; }

/* ---------- 4. FORM CONTROLS ---------- */
.input, .select, .textarea {
  width: 100%;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  font-size: 13px;
  color: var(--text-primary);
  transition: all var(--t-base);
  font-family: inherit;
}
.textarea { height: auto; padding: var(--space-3); resize: vertical; min-height: 80px; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a5adbe' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right var(--space-3) center; padding-right: var(--space-8); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--fv-violet); box-shadow: var(--shadow-glow); }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: var(--space-8); }
.input-group-icon { position: absolute; left: var(--space-3); color: var(--text-muted); pointer-events: none; }
.input-group-btn { position: absolute; right: 4px; }

.label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-2); letter-spacing: -0.005em; }
.label-required::after { content: ' *'; color: var(--fv-rose); }
.form-group { margin-bottom: var(--space-4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }

/* Checkbox & Radio */
.checkbox, .radio { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.checkbox input, .radio input { appearance: none; width: 16px; height: 16px; border: 1.5px solid var(--border-strong); border-radius: 4px; background: var(--bg-input); cursor: pointer; position: relative; transition: all var(--t-fast); }
.radio input { border-radius: 50%; }
.checkbox input:checked { background: var(--fv-violet); border-color: var(--fv-violet); }
.checkbox input:checked::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.radio input:checked { border-color: var(--fv-violet); }
.radio input:checked::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--fv-violet); }

/* Toggle switch */
.toggle { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.toggle input { appearance: none; width: 36px; height: 20px; background: var(--bg-elevated); border-radius: var(--radius-full); position: relative; cursor: pointer; transition: background var(--t-base); border: 1px solid var(--border); }
.toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: all var(--t-base); }
.toggle input:checked { background: var(--fv-violet); border-color: var(--fv-violet); }
.toggle input:checked::after { left: 18px; background: white; }

/* ---------- 5. TABLES ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); background: var(--bg-surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.table tbody td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table .primary-cell { color: var(--text-primary); font-weight: 500; }
.table .clickable { cursor: pointer; }

/* ---------- 6. AVATAR ---------- */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: var(--gradient-brand);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-xl { width: 56px; height: 56px; font-size: 18px; }
.avatar-status { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-surface); }
.avatar-status.online { background: var(--fv-emerald); }
.avatar-status.away { background: var(--fv-amber); }
.avatar-status.offline { background: var(--text-muted); }
.avatar-group { display: inline-flex; }
.avatar-group .avatar { margin-left: -8px; border: 2px solid var(--bg-surface); }
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-color-1 { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.avatar-color-2 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.avatar-color-3 { background: linear-gradient(135deg, #10b981, #14b8a6); }
.avatar-color-4 { background: linear-gradient(135deg, #f59e0b, #f43f5e); }
.avatar-color-5 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.avatar-color-6 { background: linear-gradient(135deg, #3b82f6, #1e40af); }
.avatar-color-7 { background: linear-gradient(135deg, #14b8a6, #06b6d4); }
.avatar-color-8 { background: linear-gradient(135deg, #f43f5e, #ec4899); }

/* ---------- 7. DROPDOWN / MENU ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--t-base);
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger { color: var(--fv-rose); }
.dropdown-item.danger:hover { background: rgba(244, 63, 94, 0.08); }
.dropdown-divider { height: 1px; background: var(--border-subtle); margin: var(--space-1) 0; }
.dropdown-label { padding: var(--space-2) var(--space-3); font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.06em; }

/* ---------- 8. MODAL ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-base);
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96) translateY(8px);
  transition: transform var(--t-base);
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }
.modal-header { padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: var(--space-6); }
.modal-footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: var(--space-3); }

/* ---------- 9. TABS ---------- */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-subtle); position: relative; }
.tab {
  padding: var(--space-3) var(--space-4);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color var(--t-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-primary); }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: var(--space-4); right: var(--space-4);
  height: 2px;
  background: var(--fv-violet);
  border-radius: 2px;
}
.tabs-pill { border-bottom: none; gap: var(--space-2); background: var(--bg-surface-2); padding: var(--space-1); border-radius: var(--radius-md); display: inline-flex; }
.tabs-pill .tab { padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); }
.tabs-pill .tab.active { background: var(--bg-surface); box-shadow: var(--shadow-sm); }
.tabs-pill .tab.active::after { display: none; }

/* ---------- 10. PROGRESS ---------- */
.progress { height: 6px; background: var(--bg-elevated); border-radius: var(--radius-full); overflow: hidden; position: relative; }
.progress-bar { height: 100%; background: var(--gradient-brand); border-radius: var(--radius-full); transition: width var(--t-slow); position: relative; }
.progress-bar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); animation: fv-shimmer 2s infinite; }
.progress-bar.emerald { background: linear-gradient(90deg, #10b981, #14b8a6); }
.progress-bar.amber { background: linear-gradient(90deg, #f59e0b, #f97316); }
.progress-bar.rose { background: linear-gradient(90deg, #f43f5e, #ec4899); }
.progress-bar.cyan { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.progress-lg { height: 10px; }
.progress-sm { height: 4px; }

/* ---------- 11. SEGMENTED CONTROL ---------- */
.segmented { display: inline-flex; background: var(--bg-surface-2); border-radius: var(--radius-md); padding: 3px; border: 1px solid var(--border-subtle); }
.segmented button { padding: var(--space-2) var(--space-3); font-size: 12px; font-weight: 500; color: var(--text-muted); border-radius: var(--radius-sm); transition: all var(--t-fast); display: inline-flex; align-items: center; gap: var(--space-2); }
.segmented button.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* ---------- 12. ALERTS ---------- */
.alert { display: flex; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); font-size: 13px; align-items: flex-start; }
.alert-icon { flex-shrink: 0; }
.alert-content { flex: 1; }
.alert-title { font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.alert-info { background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.2); color: var(--fv-blue); }
.alert-success { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--fv-emerald); }
.alert-warning { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2); color: var(--fv-amber); }
.alert-danger { background: rgba(244, 63, 94, 0.08); border: 1px solid rgba(244, 63, 94, 0.2); color: var(--fv-rose); }

/* ---------- 13. TOOLTIP ---------- */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 50;
}
[data-tooltip]:hover::after { opacity: 1; }

/* Force tooltips in the topbar to render below the element to prevent screen-top cropping */
.topbar [data-tooltip]::after {
  bottom: auto;
  top: calc(100% + 8px);
}

/* ---------- 14. EMPTY STATE ---------- */
.empty-state { padding: var(--space-12) var(--space-6); text-align: center; }
.empty-state-icon { width: 56px; height: 56px; border-radius: var(--radius-lg); background: var(--bg-elevated); display: inline-grid; place-items: center; color: var(--text-muted); margin-bottom: var(--space-4); }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-1); }
.empty-state-desc { font-size: 13px; color: var(--text-muted); max-width: 320px; margin: 0 auto var(--space-4); }

/* ---------- 15. SKELETON LOADER ---------- */
.skeleton { background: linear-gradient(90deg, var(--bg-elevated) 0%, var(--bg-hover) 50%, var(--bg-elevated) 100%); background-size: 200% 100%; animation: fv-shimmer 1.5s infinite; border-radius: var(--radius-sm); }

/* ---------- 16. DIVIDER ---------- */
.divider { height: 1px; background: var(--border-subtle); margin: var(--space-4) 0; }
.divider-vertical { width: 1px; background: var(--border-subtle); align-self: stretch; margin: 0 var(--space-4); }

/* ---------- 17. PAGE HEADER ---------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: var(--space-2); align-items: center; }

/* ---------- 18. BREADCRUMBS ---------- */
.breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb-sep { color: var(--text-muted); opacity: 0.5; }

/* ---------- 19. SEARCH ---------- */
.search-box { position: relative; width: 100%; }
.search-box input { padding-left: 36px; }
.search-box-icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box-kbd { position: absolute; right: var(--space-2); top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--text-muted); background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }

/* ---------- 20. KANBAN ---------- */
.kanban-board { display: flex; gap: var(--space-4); overflow-x: auto; padding-bottom: var(--space-2); min-height: 0; }
.kanban-column { flex: 0 0 300px; background: var(--bg-surface-2); border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); display: flex; flex-direction: column; max-height: 100%; }
.kanban-column-header { padding: var(--space-3) var(--space-4); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-subtle); }
.kanban-column-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: var(--space-2); }
.kanban-column-count { font-size: 11px; color: var(--text-muted); background: var(--bg-elevated); padding: 2px 8px; border-radius: var(--radius-full); }
.kanban-column-body { padding: var(--space-3); overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: var(--space-2); }
.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: grab;
  transition: all var(--t-base);
}
.kanban-card:hover { border-color: var(--border); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.4; cursor: grabbing; }
.kanban-column.drag-over { background: var(--bg-hover); border-color: var(--fv-violet); }

/* ---------- 21. TIMELINE ---------- */
.timeline { position: relative; padding-left: var(--space-6); }
.timeline::before { content: ''; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: var(--border-subtle); }
.timeline-item { position: relative; padding-bottom: var(--space-4); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -22px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--fv-violet); border: 2px solid var(--bg-surface); box-shadow: 0 0 0 2px var(--border-subtle); }
.timeline-dot.emerald { background: var(--fv-emerald); }
.timeline-dot.amber { background: var(--fv-amber); }
.timeline-dot.rose { background: var(--fv-rose); }
.timeline-content { font-size: 13px; }
.timeline-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---------- 22. CHART HELPERS ---------- */
.chart-container { position: relative; width: 100%; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: 12px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-secondary); }
.chart-legend-dot { width: 8px; height: 8px; border-radius: 2px; }

/* ---------- 23. MISC ---------- */
.kbd { display: inline-block; padding: 1px 6px; font-size: 11px; font-family: var(--font-mono); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--fv-violet); border-radius: 50%; animation: fv-spin 0.8s linear infinite; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-emerald { background: var(--fv-emerald); }
.dot-amber { background: var(--fv-amber); }
.dot-rose { background: var(--fv-rose); }
.dot-violet { background: var(--fv-violet); }
.dot-cyan { background: var(--fv-cyan); }
.dot-muted { background: var(--text-muted); }
.mono { font-family: var(--font-mono); }

/* Hover row */
.hover-row { transition: background var(--t-fast); cursor: pointer; }
.hover-row:hover { background: var(--bg-hover); }

/* Link */
.link { color: var(--fv-violet-bright); text-decoration: none; transition: color var(--t-fast); }
.link:hover { color: var(--fv-violet); text-decoration: underline; }

/* Truncate helpers */
.truncate-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.truncate-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Inline and Component Specific Icon Alignments */
.empty-state svg {
  display: block;
  margin: 0 auto 16px auto;
  color: var(--text-muted);
}
.stat-card-icon svg {
  display: block;
  margin: 0 auto;
}
.timeline-dot svg, .timeline-dot * svg {
  display: block;
  margin: 0 auto;
}
.btn-icon svg {
  vertical-align: middle;
  display: inline-block;
  margin: 0 auto;
}
.dropdown-item svg {
  margin-right: var(--space-2);
  vertical-align: -0.15em;
}
.badge svg {
  vertical-align: -0.1em;
  margin-right: var(--space-1);
}
