/* =========================================
   ANTHROBYTE — Atomic Components
   ========================================= */

/* Focus-visible outline for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.btn:focus-visible,
.input:focus-visible,
.select:focus-visible { outline-offset: 1px; }
.btn:focus:not(:focus-visible) { outline: none; }

/* ---------- 1. Button ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  line-height: var(--leading-none);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm { font-size: var(--text-sm); padding: var(--space-1) var(--space-3); height: 32px; }
.btn-md { font-size: var(--text-sm); padding: var(--space-2) var(--space-4); height: 40px; }
.btn-lg { font-size: var(--text-base); padding: var(--space-3) var(--space-6); height: 48px; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}
.btn-primary:hover:not(:disabled) { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.btn-primary:active:not(:disabled) { background: var(--color-primary-active); border-color: var(--color-primary-active); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) { background: var(--color-border); }
.btn-secondary:active:not(:disabled) { background: var(--color-border); box-shadow: inset 0 1px 2px rgba(13,13,13,0.08); }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover:not(:disabled) { background: var(--color-primary-subtle); }
.btn-outline:active:not(:disabled) { background: var(--color-primary-subtle); box-shadow: inset 0 1px 2px rgba(13,13,13,0.08); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--color-surface); color: var(--color-text-primary); }
.btn-ghost:active:not(:disabled) { background: var(--color-border); }

.btn-danger {
  background: var(--color-error);
  color: var(--color-white);
  border-color: var(--color-error);
}
.btn-danger:hover:not(:disabled) { background: var(--color-error-hover); border-color: var(--color-error-hover); }
.btn-danger:active:not(:disabled) { background: #991B1B; border-color: #991B1B; }

.btn-icon {
  padding: var(--space-1);
  aspect-ratio: 1;
}
.btn-icon.btn-sm { width: 32px; }
.btn-icon.btn-md { width: 40px; }
.btn-icon.btn-lg { width: 48px; }


/* ---------- 2. Input ---------- */

.input {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}
.input::placeholder { color: var(--color-muted); }
.input:hover { border-color: var(--color-text-secondary); }
.input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-subtle); }
.input:disabled { background: var(--color-surface); color: var(--color-muted); cursor: not-allowed; }

.input-sm { padding: var(--space-1) var(--space-3); height: 32px; }
.input-md { padding: var(--space-2) var(--space-3); height: 40px; }
.input-lg { padding: var(--space-3) var(--space-4); height: 48px; }

.input-error { border-color: var(--color-error); }
.input-error:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }

textarea.input { min-height: 80px; resize: vertical; line-height: var(--leading-normal); }
textarea.input-sm { min-height: 60px; }
textarea.input-lg { min-height: 120px; }


/* ---------- 3. Select ---------- */

.select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
  cursor: pointer;
  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='%235C5C5C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 14px;
}
.select:hover { border-color: var(--color-text-secondary); }
.select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-subtle); }
.select-sm { padding: var(--space-1) var(--space-7) var(--space-1) var(--space-3); height: 32px; }
.select-md { padding: var(--space-2) var(--space-7) var(--space-2) var(--space-3); height: 40px; }
.select-lg { padding: var(--space-3) var(--space-8) var(--space-3) var(--space-4); height: 48px; }


/* ---------- 4. Checkbox ---------- */

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}
.checkbox input {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin: 0;
  background: var(--color-elevated);
}
.checkbox input:hover { border-color: var(--color-text-secondary); }
.checkbox input:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
  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='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}
.checkbox input:indeterminate {
  background: var(--color-primary);
  border-color: var(--color-primary);
  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='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}
.checkbox input:focus-visible { box-shadow: 0 0 0 3px var(--color-primary-subtle); }
.checkbox input:disabled { opacity: 0.5; cursor: not-allowed; }


/* ---------- 5. Radio ---------- */

.radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}
.radio input {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin: 0;
  background: var(--color-elevated);
}
.radio input:hover { border-color: var(--color-text-secondary); }
.radio input:checked {
  border-color: var(--color-primary);
  border-width: 5px;
}
.radio input:focus-visible { box-shadow: 0 0 0 3px var(--color-primary-subtle); }
.radio input:disabled { opacity: 0.5; cursor: not-allowed; }


/* ---------- 6. Toggle ---------- */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  user-select: none;
}
.toggle input {
  appearance: none;
  width: 38px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin: 0;
  position: relative;
}
.toggle input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-white);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.toggle input:checked {
  background: var(--color-primary);
}
.toggle input:checked::after { left: 18px; }
.toggle input:focus-visible { box-shadow: 0 0 0 3px var(--color-primary-subtle); }
.toggle input:disabled { opacity: 0.5; cursor: not-allowed; }


/* ---------- 7. Badge ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  border-radius: var(--radius-full);
}
.badge-sm { font-size: 11px; padding: 1px var(--space-2); height: 18px; }
.badge-md { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); height: 22px; }
.badge-lg { font-size: var(--text-sm); padding: var(--space-1) var(--space-3); height: 26px; }

.badge-default { background: var(--color-surface); color: var(--color-text-secondary); }
.badge-success { background: var(--color-success-subtle); color: var(--color-success); }
.badge-warning { background: var(--color-warning-subtle); color: var(--color-warning); }
.badge-error { background: var(--color-error-subtle); color: var(--color-error); }
.badge-info { background: var(--color-info-subtle); color: var(--color-info); }

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.badge-dot.badge-default::before { background: var(--color-muted); }
.badge-dot.badge-success::before { background: var(--color-success); }
.badge-dot.badge-warning::before { background: var(--color-warning); }
.badge-dot.badge-error::before { background: var(--color-error); }
.badge-dot.badge-info::before { background: var(--color-info); }


/* ---------- 8. Avatar ---------- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  color: var(--color-white);
  background: var(--color-primary);
  overflow: hidden;
  flex-shrink: 0;
  text-transform: uppercase;
  border: 2px solid transparent;
}
.avatar-sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.avatar-md { width: 36px; height: 36px; font-size: var(--text-sm); }
.avatar-lg { width: 44px; height: 44px; font-size: var(--text-base); }
.avatar-xl { width: 56px; height: 56px; font-size: var(--text-lg); }

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-border-online { border-color: var(--color-success); }
.avatar-border-away { border-color: var(--color-warning); }
.avatar-border-offline { border-color: var(--color-border); }


/* ---------- 9. Icon ---------- */

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

.icon svg { width: 100%; height: 100%; }


/* ---------- 10. Spinner ---------- */

.spinner {
  display: inline-block;
  border-radius: var(--radius-full);
  border-style: solid;
  border-color: var(--color-border);
  border-top-color: var(--color-primary);
  animation: spin 0.6s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-md { width: 24px; height: 24px; border-width: 2.5px; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- 11. Progress ---------- */

.progress {
  width: 100%;
  height: 8px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
  min-width: 0;
}
.progress-indeterminate .progress-bar {
  width: 40%;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}
@keyframes progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}


/* ---------- 12. Tooltip ---------- */

.tooltip {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-white);
  background: var(--color-near-black);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
}
.tooltip:hover::after { opacity: 1; }


/* ---------- 13. Divider ---------- */

.divider {
  border: none;
  background: var(--color-border);
  margin: 0;
}
.divider-horizontal { height: 1px; width: 100%; }
.divider-vertical {
  width: 1px;
  height: 1em;
  display: inline-block;
  vertical-align: middle;
}


/* ---------- 14. Label ---------- */

.label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}
.label-required::after {
  content: ' *';
  color: var(--color-error);
}


/* ---------- 15. Link ---------- */

.link {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  cursor: pointer;
}
.link:hover { color: var(--color-primary-hover); text-decoration: underline; }
.link-subtle { color: var(--color-text-secondary); }
.link-subtle:hover { color: var(--color-text-primary); }


/* ---------- 16. Text / Heading ---------- */

.text-xs { font-size: var(--text-xs); line-height: var(--leading-normal); }
.text-sm { font-size: var(--text-sm); line-height: var(--leading-normal); }
.text-base { font-size: var(--text-base); line-height: var(--leading-normal); }
.text-lg { font-size: var(--text-lg); line-height: var(--leading-snug); }
.text-xl { font-size: var(--text-xl); line-height: var(--leading-snug); }
.text-2xl { font-size: var(--text-2xl); line-height: var(--leading-tight); }
.text-3xl { font-size: var(--text-3xl); line-height: var(--leading-tight); }
.text-4xl { font-size: var(--text-4xl); line-height: var(--leading-tight); }
.text-5xl { font-size: var(--text-5xl); line-height: var(--leading-tight); }
.text-6xl { font-size: var(--text-6xl); line-height: var(--leading-tight); }

.text-muted { color: var(--color-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary-color { color: var(--color-primary); }
.text-error-color { color: var(--color-error); }

.heading { font-family: var(--font-display); font-weight: var(--weight-semibold); color: var(--color-near-black); }


/* ---------- 17. KBD ---------- */

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 var(--color-border);
}


/* ---------- 18. Skeleton ---------- */

.skeleton {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-text { height: 0.8em; width: 100%; margin-bottom: var(--space-2); }
.skeleton-circle { border-radius: var(--radius-full); }
.skeleton-sm { width: 28px; height: 28px; }
.skeleton-md { width: 36px; height: 36px; }
.skeleton-lg { width: 44px; height: 44px; }

/* =========================================
   ANTHROBYTE — Molecule Components
   ========================================= */

/* ---------- 19. Input Group ---------- */

.input-group { display: flex; flex-direction: column; gap: var(--space-1); }
.input-group .hint { font-size: var(--text-xs); color: var(--color-muted); }
.input-group .error-text { font-size: var(--text-xs); color: var(--color-error); }


/* ---------- 20. Input with Icon ---------- */

.input-icon-wrap { position: relative; }
.input-icon-wrap .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
}
.input-icon-wrap .icon-leading { left: var(--space-3); }
.input-icon-wrap .icon-trailing { right: var(--space-3); }
.input-icon-wrap .input { padding-left: var(--space-8); }
.input-icon-wrap .input.icon-trailing-input { padding-right: var(--space-8); padding-left: var(--space-3); }
.input-icon-wrap .input.input-sm.icon-leading { padding-left: var(--space-7); }
.input-icon-wrap .input.input-lg.icon-leading { padding-left: var(--space-9); }


/* ---------- 21. Search Bar ---------- */

.search-bar { display: flex; gap: 0; }
.search-bar .input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}
.search-bar .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}


/* ---------- 22. Button Group ---------- */

.btn-group { display: inline-flex; }
.btn-group .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}
.btn-group .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}


/* ---------- 23. Card ---------- */

.card {
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.card-header h3 { font-size: var(--text-lg); font-family: var(--font-display); font-weight: var(--weight-semibold); color: var(--color-near-black); margin: 0; }
.card-body { padding: var(--space-6); }
.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}


/* ---------- 24. Alert ---------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.alert .icon { flex-shrink: 0; margin-top: 1px; }
.alert-content { flex: 1; }
.alert-title { font-weight: var(--weight-semibold); margin-bottom: var(--space-1); }
.alert-dismiss {
  background: none; border: none; cursor: pointer; padding: 0;
  color: inherit; opacity: 0.6; flex-shrink: 0; line-height: 1;
}
.alert-dismiss:hover { opacity: 1; }

.alert-info { background: var(--color-info-subtle); color: var(--color-info); border: 1px solid var(--color-info-border); }
.alert-success { background: var(--color-success-subtle); color: var(--color-success); border: 1px solid var(--color-success-border); }
.alert-warning { background: var(--color-warning-subtle); color: var(--color-warning); border: 1px solid var(--color-warning-border); }
.alert-error { background: var(--color-error-subtle); color: var(--color-error); border: 1px solid var(--color-error-border); }


/* ---------- 25. Toast ---------- */

.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: var(--z-toast);
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  min-width: 300px;
  max-width: 420px;
  animation: toast-in 0.3s ease-out;
}
.toast-icon { flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: var(--weight-semibold); color: var(--color-near-black); margin-bottom: 2px; }
.toast-description { color: var(--color-text-secondary); }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--color-muted); padding: 0; line-height: 1; flex-shrink: 0;
}
.toast-close:hover { color: var(--color-text-primary); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}


/* ---------- 26. Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
}
.modal {
  background: var(--color-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modal-in 0.2s ease-out;
}
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 640px; }
.modal-xl { max-width: 800px; }
.modal-full { max-width: 100vw; max-height: 100vh; border-radius: 0; height: 100vh; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
}
.modal-header h2 { font-size: var(--text-lg); font-family: var(--font-display); font-weight: var(--weight-semibold); color: var(--color-near-black); margin: 0; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--color-muted); padding: var(--space-1); line-height: 1; border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--color-surface); color: var(--color-text-primary); }
.modal-body { padding: var(--space-6); }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border-light);
}

.modal-footer-between { justify-content: space-between; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}


/* ---------- 27. Accordion ---------- */

.accordion { border: 1px solid var(--color-border-light); border-radius: var(--radius-md); overflow: hidden; }
.accordion-item { border-bottom: 1px solid var(--color-border-light); }
.accordion-item:last-child { border-bottom: none; }
.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  text-align: left;
  transition: background var(--transition-fast);
  gap: var(--space-3);
}
.accordion-trigger:hover { background: var(--color-surface); }
.accordion-arrow {
  transition: transform var(--transition-fast);
  color: var(--color-muted);
  flex-shrink: 0;
}
.accordion-trigger[aria-expanded="true"] .accordion-arrow { transform: rotate(180deg); }
.accordion-panel {
  padding: 0 var(--space-5) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}


/* ---------- 28. Tabs ---------- */

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--color-border); }
.tab {
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--color-text-primary); }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.tabs-pills { display: flex; gap: var(--space-1); border-bottom: none; }
.tabs-pills .tab {
  border-bottom: none;
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
}
.tabs-pills .tab.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}


/* ---------- 29. Breadcrumb ---------- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-muted);
  flex-wrap: wrap;
}
.breadcrumb-start {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-secondary);
  margin-right: var(--space-1);
}
.breadcrumb-start svg { display: block; }
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  padding: var(--space-1) var(--space-1);
  border-radius: var(--radius-sm);
}
.breadcrumb a:hover { color: var(--color-primary); background: var(--color-primary-subtle); }
.breadcrumb-sep { color: var(--color-muted); display: flex; align-items: center; }
.breadcrumb-current {
  color: var(--color-near-black);
  font-weight: var(--weight-semibold);
  font-family: var(--font-display);
  padding: var(--space-1) var(--space-1);
}


/* ---------- 30. Pagination ---------- */

.pagination { display: flex; align-items: center; gap: var(--space-1); }
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.page-btn:hover { background: var(--color-surface); color: var(--color-text-primary); }
.page-btn.active { background: var(--color-primary); color: var(--color-white); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }


/* ---------- 31. Dropdown Menu ---------- */

.dropdown { position: relative; display: inline-block; }
.dropdown-trigger { cursor: pointer; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  min-width: 200px;
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: var(--z-dropdown);
  display: none;
}
.dropdown.open .dropdown-menu { display: block; }

.dropdown-menu-left { right: auto; left: 0; }

.dropdown-header {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}
.dropdown-item:hover { background: var(--color-surface); }
.dropdown-item .icon { color: var(--color-muted); flex-shrink: 0; }
.dropdown-item .avatar { flex-shrink: 0; }
.dropdown-item-content { flex: 1; min-width: 0; }
.dropdown-item-title { font-weight: var(--weight-medium); }
.dropdown-item-desc { font-size: var(--text-xs); color: var(--color-muted); }
.dropdown-item-checkbox { display: flex; align-items: center; gap: var(--space-2); }
.dropdown-item-checkbox .checkbox input { width: 16px; height: 16px; }
.dropdown-item-shortcut {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-muted);
  margin-left: auto;
  flex-shrink: 0;
}

.dropdown-item-danger { color: var(--color-error); }
.dropdown-item-danger:hover { background: var(--color-error-subtle); }

.dropdown-divider { height: 1px; background: var(--color-border-light); margin: var(--space-1); }

.dropdown-search {
  padding: var(--space-2) var(--space-3) var(--space-1);
}
.dropdown-search .input { font-size: var(--text-xs); padding: var(--space-1) var(--space-2); height: 30px; }

.dropdown-scroll { max-height: 200px; overflow-y: auto; }


/* ---------- 32. File Upload ---------- */

.file-upload {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.file-upload:hover { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.file-upload-icon { color: var(--color-muted); margin-bottom: var(--space-3); }
.file-upload-text { font-size: var(--text-sm); color: var(--color-text-secondary); }
.file-upload-text strong { color: var(--color-primary); }
.file-upload-hint { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-2); }
.file-upload input { display: none; }


/* ---------- 33. Avatar Group ---------- */

.avatar-group { display: flex; }
.avatar-group .avatar { border: 2px solid var(--color-elevated); margin-left: -8px; }
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-group .avatar-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  border: 2px solid var(--color-elevated);
  margin-left: -8px;
}


/* ---------- 34. Avatar with Badge ---------- */

.avatar-badge-wrap { position: relative; display: inline-flex; }
.avatar-badge-wrap .badge {
  position: absolute;
  bottom: 0;
  right: 0;
  border: 2px solid var(--color-elevated);
  padding: 0 4px;
  height: 14px;
  font-size: 9px;
  line-height: 1;
}
.avatar-badge-wrap .badge.badge-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border-width: 2px;
}
.avatar-badge-wrap .badge.badge-dot::before { display: none; }


/* ---------- 35. List Item ---------- */

.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}
.list-item:hover { background: var(--color-surface); }
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-primary); }
.list-item-desc { font-size: var(--text-xs); color: var(--color-muted); margin-top: 1px; }
.list-item-meta { font-size: var(--text-xs); color: var(--color-muted); flex-shrink: 0; }


/* ---------- 36. Stat / Metric ---------- */

.stat { display: flex; flex-direction: column; gap: var(--space-1); }
.stat-row { flex-direction: row; align-items: baseline; gap: var(--space-2); }
.stat-compact { gap: 0; }
.stat-compact .stat-value { font-size: var(--text-xl); }
.stat-compact .stat-label { font-size: var(--text-xs); }

.stat-label { font-size: var(--text-sm); color: var(--color-muted); }
.stat-value { font-size: var(--text-3xl); font-family: var(--font-display); font-weight: var(--weight-semibold); color: var(--color-near-black); line-height: 1; }
.stat-value-sm { font-size: var(--text-xl); }
.stat-value-lg { font-size: var(--text-4xl); }

.stat-trend { font-size: var(--text-sm); font-weight: var(--weight-medium); display: flex; align-items: center; gap: var(--space-1); }
.stat-trend-up { color: var(--color-success); }
.stat-trend-down { color: var(--color-error); }
.stat-trend-neutral { color: var(--color-muted); }
.stat-desc { font-size: var(--text-xs); color: var(--color-muted); }

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-primary { background: var(--color-primary-subtle); color: var(--color-primary); }
.stat-icon-success { background: #F0FDF4; color: var(--color-success); }
.stat-icon-warning { background: #FFFBEB; color: var(--color-warning); }
.stat-icon-info { background: #EFF6FF; color: var(--color-info); }

.stat-with-icon { flex-direction: row; gap: var(--space-3); align-items: flex-start; }
.stat-with-icon .stat { flex: 1; }

.stat-progress { margin-top: var(--space-2); }
.stat-progress .progress { height: 4px; }

.stat-card { padding: var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--color-border-light); background: var(--color-elevated); }
.stat-card-border-left { border-left: 3px solid var(--color-primary); }
.stat-card-border-left.stat-card-success { border-left-color: var(--color-success); }
.stat-card-border-left.stat-card-warning { border-left-color: var(--color-warning); }
.stat-card-border-left.stat-card-error { border-left-color: var(--color-error); }

.stat-card-accent { background: var(--color-primary-subtle); border-color: var(--color-primary-border); }
.stat-card-accent .stat-value { color: var(--color-primary); }

.stat-group { display: flex; gap: 0; border: 1px solid var(--color-border-light); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-elevated); }
.stat-group .stat-card { border: none; border-radius: 0; flex: 1; border-right: 1px solid var(--color-border-light); }
.stat-group .stat-card:last-child { border-right: none; }

.stat-bar {
  height: 4px;
  border-radius: var(--radius-full);
  margin-top: var(--space-2);
  background: var(--color-surface);
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}
.stat-bar-fill-primary { background: var(--color-primary); }
.stat-bar-fill-success { background: var(--color-success); }
.stat-bar-fill-warning { background: var(--color-warning); }


/* ---------- 37. Tag Input ---------- */

.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: text;
  min-height: 40px;
  align-items: center;
}
.tag-input:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-subtle); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 1px var(--space-2);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-text-primary);
  line-height: 1.6;
}
.tag-remove {
  display: inline-flex;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--color-muted);
  line-height: 1;
}
.tag-remove:hover { color: var(--color-text-primary); }
.tag-input input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 80px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: transparent;
  padding: 0;
}
.tag-input input::placeholder { color: var(--color-muted); }

/* =========================================
   ANTHROBYTE — Organism Components
   ========================================= */

/* ---------- 38. Navbar ---------- */

.navbar {
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 var(--space-6);
  background: var(--color-elevated);
  border-bottom: 1px solid var(--color-border-light);
  gap: var(--space-6);
  flex-shrink: 0;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
  text-decoration: none;
  flex-shrink: 0;
}
.navbar-brand svg { flex-shrink: 0; }
.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
}
.navbar-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.navbar-link:hover { color: var(--color-text-primary); background: var(--color-surface); }
.navbar-link.active { color: var(--color-primary); background: var(--color-primary-subtle); }
.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}


/* ---------- 39. Sidebar ---------- */

.sidebar {
  width: 260px;
  background: var(--color-elevated);
  border-right: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-section { padding: var(--space-3) var(--space-3) 0; }
.sidebar-label {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}
.sidebar-item:hover { background: var(--color-surface); color: var(--color-text-primary); }
.sidebar-item.active { background: var(--color-primary-subtle); color: var(--color-primary); }
.sidebar-item .icon { flex-shrink: 0; }
.sidebar-item-content { flex: 1; min-width: 0; }
.sidebar-badge { margin-left: auto; }
.sidebar-arrow {
  transition: transform var(--transition-fast);
  color: var(--color-muted);
  flex-shrink: 0;
}
.sidebar-item[aria-expanded="true"] .sidebar-arrow { transform: rotate(90deg); }
.sidebar-children { padding-left: var(--space-8); }
.sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}


/* ---------- 40. Footer ---------- */

.footer {
  padding: var(--space-8) var(--space-6);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-elevated);
}
.footer-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer-nav { display: flex; gap: var(--space-5); }
.footer-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.footer-nav a:hover { color: var(--color-primary); }
.footer-copy { font-size: var(--text-sm); color: var(--color-muted); }


/* ---------- 41. Page Header ---------- */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.page-header-left {}
.page-header-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
  margin: 0;
}
.page-header-desc { font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-1); }
.page-header-right { display: flex; align-items: center; gap: var(--space-3); }


/* ---------- 42. Filter Bar ---------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.filter-bar .input { width: auto; min-width: 180px; }
.filter-bar .select { width: auto; min-width: 140px; }
.filter-label { font-size: var(--text-xs); color: var(--color-muted); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: var(--tracking-wider); }


/* ---------- 43. Stats Grid ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.stats-card {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  background: var(--color-elevated);
}


/* ---------- 44. Data Table ---------- */

/* --- Base --- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg);
  white-space: nowrap;
}
.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-primary);
  white-space: nowrap;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--color-bg); }
.table-cell-actions { text-align: right; }

/* --- 44a. Sortable --- */
.table-sortable th {
  cursor: pointer;
  user-select: none;
}
.table-sortable th::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: var(--space-2);
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--color-border);
  transition: opacity var(--transition-fast);
  opacity: 0.4;
}
.table-sortable th:hover::after { opacity: 0.8; }
.table-sortable th.sorted-asc::after {
  border-top: none;
  border-bottom: 4px solid var(--color-primary);
  opacity: 1;
}
.table-sortable th.sorted-desc::after {
  border-top: 4px solid var(--color-primary);
  opacity: 1;
}

/* --- 44b. Selectable (checkbox column) --- */
.table-selectable th:first-child,
.table-selectable td:first-child {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}
.table-selectable th:first-child::after {
  display: none;
}
.table-selectable .table-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.table-selectable tr.selected td {
  background: var(--color-primary-subtle);
}

/* --- 44c. Striped rows --- */
.table-striped tbody tr:nth-child(even) td {
  background: var(--color-bg);
}
.table-striped tbody tr:nth-child(even):hover td {
  background: var(--color-surface);
}

/* --- 44d. Compact --- */
.table-compact th {
  padding: var(--space-2) var(--space-3);
  font-size: 10px;
}
.table-compact td {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

/* --- 44e. Sticky header --- */
.table-sticky th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* --- 44f. Bordered cells --- */
.table-bordered th,
.table-bordered td {
  border: 1px solid var(--color-border-light);
}
.table-bordered th { border-bottom-width: 2px; }

/* --- 44g. With row actions (dropdown trigger per row) --- */
.table-actions td:last-child {
  text-align: right;
}
.table-actions .row-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.table-actions .row-action-btn:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
}

/* --- 44h. Expandable rows --- */
.table-expandable tr.expanded + tr.expand-detail { display: table-row; }
.table-expandable tr.expand-detail { display: none; }
.table-expandable tr.expand-detail td {
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-8);
  background: var(--color-bg);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.table-expandable .expand-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-base);
}
.table-expandable .expand-trigger:hover { color: var(--color-text-primary); }

/* --- 44i. Empty state --- */
.table-empty td {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--color-muted);
  font-size: var(--text-sm);
  border-bottom: none;
}
.table-empty .table-empty-icon {
  margin-bottom: var(--space-3);
  opacity: 0.3;
}
.table-empty .table-empty-text {
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}
.table-empty .table-empty-hint {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

/* --- 44j. Wrapper toolbar --- */
.table-wrap-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}
.table-wrap-header .table-wrap-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-right: auto;
}
.table-wrap-header .table-wrap-count {
  font-size: var(--text-xs);
  color: var(--color-muted);
}


/* ---------- 45. Activity Feed ---------- */

.activity-feed { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-light);
  position: relative;
}
.activity-item:last-child { border-bottom: none; }
.activity-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 24px;
}
.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  flex-shrink: 0;
  margin-top: 4px;
}
.activity-dot-success { background: var(--color-success); }
.activity-dot-warning { background: var(--color-warning); }
.activity-dot-error { background: var(--color-error); }
.activity-dot-primary { background: var(--color-primary); }
.activity-line::after {
  content: '';
  width: 1px;
  flex: 1;
  background: var(--color-border-light);
  min-height: 12px;
}
.activity-item:last-child .activity-line::after { display: none; }
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: var(--text-sm); color: var(--color-text-primary); }
.activity-time { font-size: var(--text-xs); color: var(--color-muted); margin-top: 2px; }


/* ---------- 46. Notification Panel ---------- */

.notif-panel {
  width: 360px;
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
}
.notif-header h3 { font-size: var(--text-base); font-family: var(--font-display); font-weight: var(--weight-semibold); margin: 0; }
.notif-count { font-size: var(--text-xs); color: var(--color-muted); }
.notif-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
  cursor: pointer;
}
.notif-item:hover { background: var(--color-bg); }
.notif-item-unread { background: var(--color-primary-subtle); }
.notif-item:last-child { border-bottom: none; }
.notif-content { flex: 1; min-width: 0; }
.notif-text { font-size: var(--text-sm); color: var(--color-text-primary); }
.notif-time { font-size: var(--text-xs); color: var(--color-muted); margin-top: 2px; }
.notif-footer {
  padding: var(--space-3) var(--space-5);
  text-align: center;
  border-top: 1px solid var(--color-border-light);
}
.notif-footer a { font-size: var(--text-sm); color: var(--color-primary); text-decoration: none; }
.notif-footer a:hover { text-decoration: underline; }


/* ---------- 47. Empty State ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  margin-bottom: var(--space-4);
}
.empty-state-title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-semibold); color: var(--color-near-black); margin-bottom: var(--space-2); }
.empty-state-desc { font-size: var(--text-sm); color: var(--color-text-secondary); max-width: 360px; margin-bottom: var(--space-5); }


/* ---------- 48. Error State ---------- */

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
}
.error-code { font-family: var(--font-display); font-size: var(--text-6xl); font-weight: var(--weight-bold); color: var(--color-border); line-height: 1; margin-bottom: var(--space-2); }
.error-state-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-semibold); color: var(--color-near-black); margin-bottom: var(--space-2); }
.error-state-desc { font-size: var(--text-sm); color: var(--color-text-secondary); max-width: 400px; margin-bottom: var(--space-5); }


/* ---------- 49. Confirm Dialog ---------- */

.confirm-dialog {
  background: var(--color-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 400px;
  padding: var(--space-6);
  text-align: center;
}
.confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}
.confirm-icon-danger { background: #FEF2F2; color: var(--color-error); }
.confirm-icon-warning { background: #FFFBEB; color: var(--color-warning); }
.confirm-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--color-near-black); margin-bottom: var(--space-2); }
.confirm-desc { font-size: var(--text-sm); color: var(--color-text-secondary); margin-bottom: var(--space-5); }
.confirm-actions { display: flex; gap: var(--space-3); justify-content: center; }


/* ---------- 50. Detail Panel (Drawer) ---------- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: var(--z-modal);
  display: flex;
  justify-content: flex-end;
}
.drawer {
  width: 480px;
  max-width: 100vw;
  background: var(--color-elevated);
  height: 100%;
  overflow-y: auto;
  animation: drawer-in 0.25s ease-out;
}
.drawer-sm { width: 360px; }
.drawer-lg { width: 640px; }
.drawer-left { animation-name: drawer-in-left; }
.drawer-overlay-left { justify-content: flex-start; }
@keyframes drawer-in-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
  position: sticky;
  top: 0;
  background: var(--color-elevated);
  z-index: 1;
}
.drawer-header h2 { font-size: var(--text-lg); font-family: var(--font-display); font-weight: var(--weight-semibold); margin: 0; }
.drawer-body { padding: var(--space-6); }
.drawer-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  position: sticky;
  bottom: 0;
  background: var(--color-elevated);
}
@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}


/* ---------- 51. Form Section ---------- */

.form-section {
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.form-section-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--color-near-black); margin-bottom: var(--space-1); }
.form-section-desc { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-5); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-grid-full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: var(--space-3); padding-top: var(--space-5); border-top: 1px solid var(--color-border-light); margin-top: var(--space-5); }


/* ---------- 52. Kanban Board ---------- */

.kanban { display: flex; gap: var(--space-4); overflow-x: auto; padding-bottom: var(--space-4); }
.kanban-col {
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}
.kanban-col-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); display: flex; align-items: center; gap: var(--space-2); }
.kanban-col-count { font-size: var(--text-xs); color: var(--color-muted); }
.kanban-card {
  padding: var(--space-4);
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.kanban-card:hover { border-color: var(--color-border); box-shadow: var(--shadow-sm); }
.kanban-card-title { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-primary); margin-bottom: var(--space-2); }
.kanban-card-desc { font-size: var(--text-xs); color: var(--color-text-secondary); margin-bottom: var(--space-3); }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; }


/* ---------- 53. Team Members ---------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.team-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  transition: border-color var(--transition-fast);
}
.team-card:hover { border-color: var(--color-border); }
.team-card-content { flex: 1; min-width: 0; }
.team-card-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-primary); }
.team-card-role { font-size: var(--text-xs); color: var(--color-muted); margin-top: 1px; }
.team-card-actions { flex-shrink: 0; }


/* ---------- 54. User Profile Card ---------- */

.profile-card {
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.profile-cover {
  height: 80px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
}
.profile-body {
  padding: 0 var(--space-6) var(--space-6);
  margin-top: -28px;
  text-align: center;
}
.profile-body .avatar { margin: 0 auto; }
.profile-name { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--color-near-black); margin-top: var(--space-2); }
.profile-email { font-size: var(--text-sm); color: var(--color-muted); }
.profile-meta { display: flex; justify-content: center; gap: var(--space-6); padding: var(--space-4) 0; margin-top: var(--space-4); border-top: 1px solid var(--color-border-light); }
.profile-meta-item { text-align: center; }
.profile-meta-value { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--color-near-black); }
.profile-meta-label { font-size: var(--text-xs); color: var(--color-muted); }


/* ---------- 55. Side Navigation (Vertical Tabs) ---------- */

.side-nav {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
}
.side-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  cursor: pointer;
}
.side-nav-item:hover { background: var(--color-surface); color: var(--color-text-primary); }
.side-nav-item.active { background: var(--color-primary-subtle); color: var(--color-primary); }
.side-nav-item .icon { flex-shrink: 0; }
.side-nav-item-content { flex: 1; }
.side-nav-badge { margin-left: auto; }
.side-nav-danger { color: var(--color-error); }
.side-nav-danger:hover { background: #FEF2F2; color: var(--color-error); }

/* ---------- 56. Settings Section ---------- */

.settings-layout { display: flex; gap: var(--space-6); }
.settings-nav {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.settings-nav-item:hover { background: var(--color-surface); color: var(--color-text-primary); }
.settings-nav-item.active { background: var(--color-primary-subtle); color: var(--color-primary); }
.settings-content { flex: 1; min-width: 0; }
.settings-content .form-section { margin-bottom: var(--space-4); }


/* ---------- 57. Inbox / Message List ---------- */

.inbox { border: 1px solid var(--color-border-light); border-radius: var(--radius-lg); background: var(--color-elevated); overflow: hidden; }
.inbox-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.inbox-item:hover { background: var(--color-bg); }
.inbox-item-unread { background: var(--color-primary-subtle); }
.inbox-item:last-child { border-bottom: none; }
.inbox-content { flex: 1; min-width: 0; }
.inbox-sender { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-primary); }
.inbox-subject { font-size: var(--text-sm); color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-preview { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-time { font-size: var(--text-xs); color: var(--color-muted); flex-shrink: 0; }


/* ---------- 58. Comment Thread ---------- */

.comment-thread { display: flex; flex-direction: column; gap: var(--space-4); }
.comment {
  display: flex;
  gap: var(--space-3);
}
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
.comment-author { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-primary); }
.comment-time { font-size: var(--text-xs); color: var(--color-muted); }
.comment-text { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: var(--leading-relaxed); }
.comment-actions { display: flex; gap: var(--space-3); margin-top: var(--space-2); }
.comment-actions button { font-size: var(--text-xs); color: var(--color-muted); background: none; border: none; cursor: pointer; padding: 0; }
.comment-actions button:hover { color: var(--color-primary); }
.comment-input { display: flex; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-border-light); margin-top: var(--space-3); }
.comment-input .input { flex: 1; }


/* ---------- 59. Onboarding Stepper ---------- */

.stepper { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: var(--space-8); }
.stepper-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  border: 2px solid var(--color-border);
  color: var(--color-muted);
  flex-shrink: 0;
}
.stepper-step.active .stepper-circle { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-white); }
.stepper-step.completed .stepper-circle { background: var(--color-success); border-color: var(--color-success); color: var(--color-white); }
.stepper-step.active { color: var(--color-text-primary); }
.stepper-step.completed { color: var(--color-text-primary); }
.stepper-line {
  width: 40px;
  height: 1px;
  background: var(--color-border);
  margin: 0 var(--space-2);
}
.stepper-line.completed { background: var(--color-success); }


/* ---------- 60. Audit Log ---------- */

.audit-log { display: flex; flex-direction: column; }
.audit-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}
.audit-item:hover { background: var(--color-bg); }
.audit-item:last-child { border-bottom: none; }
.audit-time { color: var(--color-muted); flex-shrink: 0; min-width: 60px; font-size: var(--text-xs); }
.audit-action { flex: 1; color: var(--color-text-primary); }
.audit-actor { color: var(--color-text-secondary); flex-shrink: 0; }


/* ---------- 61. 404 Page ---------- */

.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: var(--space-12) var(--space-6);
}


/* =========================================
   CHARTS
   ========================================= */

.chart-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  padding: var(--space-5);
}
.chart-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.chart-card-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-right: auto;
}
.chart-card-desc {
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.chart-body {
  position: relative;
}
.chart-body svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Legend */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
  justify-content: center;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Tooltip */
.chart-tooltip {
  position: fixed;
  background: var(--color-near-black);
  color: var(--color-white);
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  pointer-events: none;
  z-index: var(--z-toast);
  white-space: nowrap;
  display: none;
  line-height: var(--leading-snug);
  font-family: var(--font-body);
  box-shadow: var(--shadow-md);
  transition: opacity 120ms ease;
}
.chart-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--color-near-black);
}
.chart-tooltip.tip-top::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--color-near-black);
}
.chart-tooltip.tip-left::after {
  top: 50%;
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-top: -5px;
  border-top-color: transparent;
  border-right-color: var(--color-near-black);
}
.chart-tooltip.tip-right::after {
  top: 50%;
  left: 100%;
  margin-left: 0;
  margin-top: -5px;
  border-top-color: transparent;
  border-left-color: var(--color-near-black);
}

/* Axis */
.chart-axis-label {
  font-size: 9px;
  fill: var(--chart-text);
  font-family: var(--font-body);
}
.chart-grid-line {
  stroke: var(--chart-grid);
  stroke-width: 1;
}
.chart-zero-line {
  stroke: var(--color-border);
  stroke-width: 1.5;
}

/* Chart value labels */
.chart-value-label {
  font-size: 9px;
  fill: var(--color-text-secondary);
  font-family: var(--font-body);
  text-anchor: middle;
}
.chart-value-label-bar {
  font-size: 8px;
  fill: var(--color-muted);
  font-family: var(--font-body);
  text-anchor: middle;
}

/* Data point dots */
.chart-dot {
  stroke: var(--color-white);
  stroke-width: 2;
  cursor: pointer;
  transition: r var(--transition-fast);
}
.chart-dot:hover { r: 5; }

/* Pie slice hover */
.chart-pie-slice { cursor: pointer; transition: opacity var(--transition-fast); }
.chart-pie-slice:hover { opacity: 0.8; }

/* Bar hover */
.chart-bar { cursor: pointer; transition: opacity var(--transition-fast); }
.chart-bar:hover { opacity: 0.8; }

/* Funnel */
.chart-funnel-segment { cursor: pointer; transition: opacity var(--transition-fast); }
.chart-funnel-segment:hover { opacity: 0.85; }

/* Heatmap cell */
.chart-heat-cell { cursor: pointer; transition: opacity var(--transition-fast); }
.chart-heat-cell:hover { opacity: 0.8; stroke: var(--color-near-black); stroke-width: 1.5; }


/* =========================================
   PATTERNS
   ========================================= */

/* ---------- 62. Chat Interface ---------- */

.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-near-black); }
.chat-header-status { font-size: var(--text-xs); color: var(--color-muted); }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--color-bg);
}
.chat-bubble {
  max-width: 75%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  position: relative;
  word-wrap: break-word;
}
.chat-bubble-sent {
  align-self: flex-end;
  background: var(--color-primary);
  color: var(--color-white);
  border-bottom-right-radius: var(--radius-sm);
}
.chat-bubble-received {
  align-self: flex-start;
  background: var(--color-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-light);
  border-bottom-left-radius: var(--radius-sm);
}
.chat-bubble-time {
  font-size: 9px;
  opacity: 0.65;
  margin-top: var(--space-1);
  display: block;
  text-align: right;
}
.chat-bubble-received .chat-bubble-time { text-align: left; }
.chat-bubble-avatar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}
.chat-bubble-avatar .avatar { flex-shrink: 0; }
.chat-typing {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  align-self: flex-start;
}
.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-muted);
  animation: chatTyping 1.4s infinite ease-in-out;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatTyping {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-elevated);
  flex-shrink: 0;
}
.chat-input-bar .input { flex: 1; }
.chat-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-primary);
  color: var(--color-white);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--color-primary-hover); }
.chat-send-btn svg { width: 16px; height: 16px; }


/* ---------- 63. Message Scroller ---------- */

.msg-list {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  overflow-y: auto;
}
.msg-date-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  position: sticky;
  top: 0;
  background: var(--color-elevated);
  z-index: 1;
}
.msg-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-light);
}
.msg-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--color-border-light);
}
.msg-item:hover { background: var(--color-bg); }
.msg-item:last-child { border-bottom: none; }
.msg-item-unread { background: var(--color-primary-subtle); }
.msg-item-unread:hover { background: var(--color-primary-border); }
.msg-item .avatar { flex-shrink: 0; }
.msg-content { flex: 1; min-width: 0; }
.msg-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 2px;
}
.msg-sender {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-near-black);
}
.msg-item-unread .msg-sender { font-weight: var(--weight-semibold); }
.msg-time {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-left: auto;
  flex-shrink: 0;
}
.msg-preview {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-item-unread .msg-preview { color: var(--color-text-primary); font-weight: var(--weight-medium); }
.msg-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  flex-shrink: 0;
  margin-top: var(--space-1);
}


/* ---------- 64. Side Sheet ---------- */

.side-sheet-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  z-index: var(--z-modal);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.side-sheet-overlay.open { opacity: 1; pointer-events: auto; }
.side-sheet {
  width: 400px;
  max-width: 100%;
  height: 100%;
  background: var(--color-elevated);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-xl);
}
.side-sheet-overlay.open .side-sheet { transform: translateX(0); }
.side-sheet-sm .side-sheet { width: 320px; }
.side-sheet-lg .side-sheet { width: 560px; }
.side-sheet-left { justify-content: flex-start; }
.side-sheet-left .side-sheet { transform: translateX(-100%); }
.side-sheet-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}
.side-sheet-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
  margin-right: auto;
}
.side-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  font-size: var(--text-lg);
  transition: all var(--transition-fast);
}
.side-sheet-close:hover { background: var(--color-surface); color: var(--color-text-primary); }
.side-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}
.side-sheet-footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border-light);
  flex-shrink: 0;
}
.side-sheet-footer .btn:last-child { margin-left: auto; }


/* ---------- 65. Popover ---------- */

.popover-container {
  position: relative;
  display: inline-block;
}
.popover-trigger {
  cursor: pointer;
}
.popover {
  position: absolute;
  z-index: var(--z-dropdown);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.popover.open { opacity: 1; pointer-events: auto; }
.popover-content {
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  max-width: 320px;
}
.popover-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  transform: rotate(45deg);
  z-index: -1;
}
.popover-top { bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-6px); }
.popover-top.open { transform: translateX(-50%) translateY(-8px); }
.popover-top .popover-arrow { bottom: -5px; left: calc(50% - 5px); border-top: none; border-left: none; }
.popover-bottom { top: 100%; left: 50%; transform: translateX(-50%) translateY(6px); }
.popover-bottom.open { transform: translateX(-50%) translateY(8px); }
.popover-bottom .popover-arrow { top: -5px; left: calc(50% - 5px); border-bottom: none; border-right: none; }
.popover-left { right: 100%; top: 50%; transform: translateY(-50%) translateX(-6px); }
.popover-left.open { transform: translateY(-50%) translateX(-8px); }
.popover-left .popover-arrow { right: -5px; top: calc(50% - 5px); border-left: none; border-bottom: none; }
.popover-right { left: 100%; top: 50%; transform: translateY(-50%) translateX(6px); }
.popover-right.open { transform: translateY(-50%) translateX(8px); }
.popover-right .popover-arrow { left: -5px; top: calc(50% - 5px); border-right: none; border-top: none; }


/* ---------- 66. Date & Time Picker ---------- */

.date-picker {
  display: inline-block;
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  width: 280px;
}
.dp-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.dp-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.dp-nav:hover { background: var(--color-surface); color: var(--color-text-primary); }
.dp-title {
  flex: 1;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
}
.dp-day-names {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: var(--space-2);
}
.dp-day-name {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-muted);
  padding: var(--space-1) 0;
  font-weight: var(--weight-medium);
}
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  background: none;
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}
.dp-day:hover { background: var(--color-surface); }
.dp-day-other { color: var(--color-border); }
.dp-day-today { font-weight: var(--weight-semibold); color: var(--color-primary); }
.dp-day-selected { background: var(--color-primary); color: var(--color-white); font-weight: var(--weight-semibold); }
.dp-day-selected:hover { background: var(--color-primary-hover); }
.dp-day-disabled { color: var(--color-border); cursor: not-allowed; }
.dp-day-disabled:hover { background: none; }

/* Time picker */
.time-picker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-light);
}
.time-picker .select { min-width: 80px; }
.time-picker-sep {
  color: var(--color-muted);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}


/* ---------- 67. Attachments ---------- */

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.attachment {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: background var(--transition-fast);
}
.attachment:hover { background: var(--color-surface); }
.attachment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  flex-shrink: 0;
}
.attachment-icon-pdf { background: #FEF2F2; color: var(--color-error); }
.attachment-icon-image { background: #F0FDF4; color: var(--color-success); }
.attachment-icon-zip { background: #FFF7ED; color: var(--color-warning); }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-size {
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.attachment-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  font-size: var(--text-base);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.attachment-remove:hover { background: #FEF2F2; color: var(--color-error); }

/* Attachment preview (image) */
.attachment-preview {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.attachment-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  cursor: pointer;
}
.attachment-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attachment-preview-item .attachment-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(13,13,13,0.6);
  color: white;
  width: 20px;
  height: 20px;
  font-size: 12px;
  border-radius: var(--radius-full);
}
.attachment-preview-item .attachment-remove:hover { background: rgba(220,38,38,0.8); color: white; }


/* ---------- 68. Rich Tooltip ---------- */

.tooltip-rich {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  cursor: help;
  border-bottom: 1px dashed var(--color-border);
}
.tooltip-rich-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-near-black);
  color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  max-width: 300px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  transform: translateX(-50%) translateY(4px);
  z-index: var(--z-dropdown);
}
.tooltip-rich:hover .tooltip-rich-content { opacity: 1; transform: translateX(-50%) translateY(0); }
.tooltip-rich-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--color-near-black);
}
.tooltip-rich-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}
.tooltip-rich-body {
  font-size: var(--text-xs);
  opacity: 0.85;
  line-height: var(--leading-relaxed);
}
.tooltip-rich-icon {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
  flex-shrink: 0;
}


/* ---------- 69. Field Options ---------- */

/* Combo box */
.combobox {
  position: relative;
  display: inline-block;
  width: 100%;
}
.combobox .input {
  width: 100%;
  padding-right: var(--space-8);
  cursor: pointer;
}
.combobox-arrow {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
  transition: transform var(--transition-fast);
}
.combobox.open .combobox-arrow { transform: translateY(-50%) rotate(180deg); }
.combobox-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.combobox.open .combobox-menu { display: block; }
.combobox-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.combobox-option:hover { background: var(--color-surface); }
.combobox-option.active { background: var(--color-primary-subtle); color: var(--color-primary); }
.combobox-option-icon {
  width: 16px;
  height: 16px;
  color: var(--color-muted);
  flex-shrink: 0;
}

/* Multi-select */
.multi-select {
  position: relative;
  display: inline-block;
  width: 100%;
}
.multi-select-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  min-height: 40px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-elevated);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.multi-select-trigger:hover { border-color: var(--color-primary); }
.multi-select-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
}
.multi-select-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  background: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  border-radius: var(--radius-full);
}
.multi-select-chip-remove:hover { background: var(--color-primary); color: var(--color-white); }
.multi-select-placeholder {
  font-size: var(--text-sm);
  color: var(--color-muted);
  padding: 0 var(--space-1);
}
.multi-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.multi-select.open .multi-select-menu { display: block; }
.multi-select-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.multi-select-option:hover { background: var(--color-surface); }
.multi-select-option .checkbox { pointer-events: none; }

/* Phone input */
.phone-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-elevated);
  transition: border-color var(--transition-fast);
  overflow: hidden;
}
.phone-input:focus-within { border-color: var(--color-primary); }
.phone-input-country {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-3);
  border-right: 1px solid var(--color-border);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  background: var(--color-bg);
  height: 100%;
  min-height: 40px;
  flex-shrink: 0;
}
.phone-input-flag { font-size: var(--text-base); }
.phone-input .input {
  border: none;
  border-radius: 0;
  flex: 1;
}
.phone-input .input:focus { box-shadow: none; }

/* Color input */
.color-input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.color-input-swatch {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.color-input-swatch input[type="color"] {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}
.color-input-hex {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.color-input-presets {
  display: flex;
  gap: var(--space-1);
}
.color-input-preset {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.color-input-preset:hover { border-color: var(--color-border); }
.color-input-preset.active { border-color: var(--color-near-black); }

/* ---------- 70. Risk Matrix ---------- */
.risk-matrix {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-elevated);
}
.risk-matrix-header {
  display: grid;
  gap: 1px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
}
.risk-matrix-header-cell {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}
.risk-matrix-row {
  display: grid;
  gap: 1px;
  background: var(--color-border-light);
}
.risk-matrix-row:not(:last-child) { border-bottom: 0; }
.risk-matrix-row:hover .risk-matrix-label,
.risk-matrix-row:hover .risk-matrix-cell { background: var(--color-surface); }
.risk-matrix-label {
  padding: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-near-black);
  background: var(--color-elevated);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.risk-matrix-cell {
  padding: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-align: center;
  background: var(--color-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}
.risk-cell-critical { background: var(--color-error-subtle); color: var(--color-error); }
.risk-cell-high { background: #FFF7ED; color: #EA580C; }
.risk-cell-medium { background: var(--color-warning-subtle); color: var(--color-warning); }
.risk-cell-low { background: var(--color-success-subtle); color: var(--color-success); }
.risk-cell-na { background: var(--color-surface); color: var(--color-muted); }
.risk-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}
.risk-score-critical { background: var(--color-error-subtle); color: var(--color-error); }
.risk-score-high { background: #FFF7ED; color: #EA580C; }
.risk-score-medium { background: var(--color-warning-subtle); color: var(--color-warning); }
.risk-score-low { background: var(--color-success-subtle); color: var(--color-success); }

/* ---------- 71. Supplier / Vendor Profile ---------- */
.supplier-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}
.supplier-card:hover { box-shadow: var(--shadow-sm); }
.supplier-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
}
.supplier-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  flex-shrink: 0;
}
.supplier-info { flex: 1; }
.supplier-name { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--color-near-black); }
.supplier-meta { font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-1); }
.supplier-body { padding: var(--space-5); }
.supplier-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.supplier-metric {}
.supplier-metric-value { font-size: var(--text-xl); font-weight: var(--weight-semibold); color: var(--color-near-black); }
.supplier-metric-label { font-size: var(--text-xs); color: var(--color-muted); }
.supplier-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
}
.supplier-detail-label { color: var(--color-muted); }
.supplier-detail-value { color: var(--color-near-black); font-weight: var(--weight-medium); }
.supplier-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

/* ---------- 72. Price Comparison Table ---------- */
.price-compare {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-elevated);
}
.price-compare-table { width: 100%; border-collapse: collapse; }
.price-compare-table th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  text-align: left;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
}
.price-compare-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border-light);
}
.price-compare-table tr:last-child td { border-bottom: none; }
.price-compare-table tr:hover td { background: var(--color-surface); }
.price-amount { font-weight: var(--weight-semibold); color: var(--color-near-black); }
.price-amount.current { font-size: var(--text-base); color: var(--color-primary); }
.price-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.price-change.up { color: var(--color-success); }
.price-change.down { color: var(--color-error); }
.price-best {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  background: var(--color-success-subtle);
  color: var(--color-success);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

/* ---------- 73. Compliance Status Tracker ---------- */
.compliance-tracker {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  overflow: hidden;
}
.compliance-tracker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
}
.compliance-tracker-summary {
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--color-muted);
}
.compliance-tracker-summary span { display: flex; align-items: center; gap: var(--space-1); }
.compliance-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}
.compliance-item:last-child { border-bottom: none; }
.compliance-item:hover { background: var(--color-surface); }
.compliance-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 100px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.status-dot-compliant { background: var(--color-success); }
.status-dot-non-compliant { background: var(--color-error); }
.status-dot-pending { background: var(--color-warning); }
.status-dot-monitoring { background: var(--color-info); }
.compliance-info { flex: 1; }
.compliance-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-near-black); }
.compliance-desc { font-size: var(--text-xs); color: var(--color-muted); margin-top: 2px; }
.compliance-date { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; }

/* ---------- 74. BoM Tree / Hierarchy Viewer ---------- */
.bom-tree {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  padding: var(--space-2);
  font-size: var(--text-sm);
}
.bom-node {}
.bom-node-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.bom-node-header:hover { background: var(--color-surface); }
.bom-node-toggle {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-muted);
  transition: transform var(--transition-fast);
  font-size: var(--text-xs);
}
.bom-node-toggle.open { transform: rotate(90deg); }
.bom-node-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: var(--weight-bold);
}
.bom-node-icon.assembly { background: var(--color-primary-subtle); color: var(--color-primary); }
.bom-node-icon.part { background: var(--color-surface); color: var(--color-muted); }
.bom-node-icon.document { background: var(--color-warning-subtle); color: var(--color-warning); }
.bom-node-label { flex: 1; font-weight: var(--weight-medium); color: var(--color-near-black); }
.bom-node-qty { font-size: var(--text-xs); color: var(--color-muted); margin-right: var(--space-3); }
.bom-node-ref { font-size: var(--text-xs); color: var(--color-muted); font-family: var(--font-mono); }
.bom-children { padding-left: var(--space-6); display: none; }
.bom-children.open { display: block; }

/* ---------- 75. SKU / Product Catalog List ---------- */
.sku-list {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  overflow: hidden;
}
.sku-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  gap: var(--space-3);
}
.sku-list-count { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; }
.sku-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}
.sku-item:last-child { border-bottom: none; }
.sku-item:hover { background: var(--color-surface); }
.sku-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-lg);
}
.sku-info { flex: 1; min-width: 0; }
.sku-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-near-black); }
.sku-code { font-size: var(--text-xs); color: var(--color-muted); font-family: var(--font-mono); margin-top: 1px; }
.sku-meta { display: flex; gap: var(--space-3); align-items: center; }
.sku-category {
  font-size: var(--text-xs);
  color: var(--color-muted);
  padding: 1px var(--space-2);
  background: var(--color-surface);
  border-radius: var(--radius-full);
}
.sku-price { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-near-black); white-space: nowrap; }

/* ---------- 76. Integration Connector Card ---------- */
.connector-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: box-shadow var(--transition-fast);
}
.connector-card:hover { box-shadow: var(--shadow-sm); }
.connector-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.connector-info { flex: 1; }
.connector-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-near-black); }
.connector-status-text { font-size: var(--text-xs); color: var(--color-muted); margin-top: 2px; }
.connector-meta { font-size: var(--text-xs); color: var(--color-muted); text-align: right; }
.connector-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.connector-status-badge.connected { background: var(--color-success-subtle); color: var(--color-success); }
.connector-status-badge.disconnected { background: var(--color-error-subtle); color: var(--color-error); }
.connector-status-badge.syncing { background: var(--color-info-subtle); color: var(--color-info); }
.connector-status-badge.error { background: var(--color-error-subtle); color: var(--color-error); }

/* ---------- 77. Approval Panel ---------- */
.approval-panel {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  overflow: hidden;
}
.approval-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}
.approval-item:last-child { border-bottom: none; }
.approval-item:hover { background: var(--color-surface); }
.approval-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}
.approval-content { flex: 1; min-width: 0; }
.approval-title { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-near-black); }
.approval-desc { font-size: var(--text-xs); color: var(--color-muted); margin-top: 2px; }
.approval-meta { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-1); }
.approval-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.approval-status-badge {
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.approval-status-badge.pending { background: var(--color-warning-subtle); color: var(--color-warning); }
.approval-status-badge.approved { background: var(--color-success-subtle); color: var(--color-success); }
.approval-status-badge.rejected { background: var(--color-error-subtle); color: var(--color-error); }

/* ---------- 78. Subscription / Plan Card ---------- */
.plan-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  padding: var(--space-6);
  text-align: center;
  position: relative;
  transition: box-shadow var(--transition-fast);
}
.plan-card:hover { box-shadow: var(--shadow-md); }
.plan-card.plan-popular {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}
.plan-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.plan-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.plan-price { font-size: var(--text-4xl); font-weight: var(--weight-bold); color: var(--color-near-black); margin: var(--space-3) 0; font-family: var(--font-display); }
.plan-price span { font-size: var(--text-base); font-weight: var(--weight-regular); color: var(--color-muted); }
.plan-desc { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--space-5); }
.plan-features { list-style: none; padding: 0; margin: 0 0 var(--space-6); text-align: left; }
.plan-features li {
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-near-black);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.plan-features li::before { content: "✓"; color: var(--color-success); font-weight: var(--weight-bold); }

/* ---------- 79. Data Import Zone ---------- */
.import-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--color-elevated);
}
.import-zone:hover,
.import-zone.import-zone-active { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.import-zone-icon { font-size: 32px; margin-bottom: var(--space-3); color: var(--color-muted); }
.import-zone-text { font-size: var(--text-sm); color: var(--color-muted); }
.import-zone-text strong { color: var(--color-near-black); }
.import-zone-hint { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-2); }
.import-preview {
  margin-top: var(--space-4);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.import-preview-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.import-preview-table th {
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  font-weight: var(--weight-semibold);
  color: var(--color-muted);
  font-size: var(--text-xs);
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}
.import-preview-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-near-black);
}
.import-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
}
.import-status-bar {
  flex: 1;
  height: 4px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.import-status-fill { height: 100%; background: var(--color-primary); border-radius: var(--radius-full); transition: width var(--transition-base); }

/* ---------- 80. API Key Manager ---------- */
.api-key-manager {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  overflow: hidden;
}
.api-key-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
}
.api-key-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}
.api-key-row:last-child { border-bottom: none; }
.api-key-row:hover { background: var(--color-surface); }
.api-key-name { flex: 1; }
.api-key-name-text { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-near-black); }
.api-key-name-date { font-size: var(--text-xs); color: var(--color-muted); margin-top: 1px; }
.api-key-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
  background: var(--color-surface);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  letter-spacing: 0.1em;
  min-width: 180px;
  text-align: center;
}
.api-key-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* ---------- 81. Alert / Rule Builder ---------- */
.rule-builder {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  padding: var(--space-4);
}
.rule-group {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.rule-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rule-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}
.rule-row + .rule-row { border-top: 1px solid var(--color-border-light); }
.rule-field {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--color-elevated);
  color: var(--color-near-black);
  min-width: 120px;
}
.rule-operator {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--color-elevated);
  color: var(--color-near-black);
  min-width: 80px;
}
.rule-value {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--color-elevated);
  color: var(--color-near-black);
  flex: 1;
  min-width: 100px;
}
.rule-remove {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  font-size: var(--text-lg);
}
.rule-remove:hover { color: var(--color-error); background: var(--color-error-subtle); }
.rule-add {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  width: 100%;
  justify-content: center;
  margin-top: var(--space-2);
  transition: all var(--transition-fast);
}
.rule-add:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ---------- 82. Timeline / Gantt Chart ---------- */
.gantt {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  overflow: hidden;
}
.gantt-header {
  display: grid;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
}
.gantt-header-cell {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-weight: var(--weight-semibold);
  text-align: center;
  border-right: 1px solid var(--color-border-light);
}
.gantt-header-cell:last-child { border-right: none; }
.gantt-body {}
.gantt-row {
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}
.gantt-row:last-child { border-bottom: none; }
.gantt-row:hover { background: var(--color-surface); }
.gantt-label {
  padding: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-near-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-track {
  position: relative;
  height: 28px;
  padding: 0 var(--space-2);
  display: flex;
  align-items: center;
}
.gantt-bar {
  height: 20px;
  border-radius: var(--radius-full);
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: var(--weight-semibold);
  color: white;
  min-width: 20px;
}
.gantt-bar-primary { background: var(--color-primary); }
.gantt-bar-success { background: var(--color-success); }
.gantt-bar-info { background: var(--color-info); }
.gantt-bar-warning { background: var(--color-warning); }
.gantt-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-error);
  z-index: 1;
}
.gantt-marker::before {
  content: "▼";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--color-error);
}

/* ---------- 83. Benchmark Chart ---------- */
.benchmark {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  padding: var(--space-5);
}
.benchmark-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}
.benchmark-label {
  width: 100px;
  font-size: var(--text-sm);
  color: var(--color-near-black);
  font-weight: var(--weight-medium);
  flex-shrink: 0;
}
.benchmark-track {
  flex: 1;
  height: 20px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}
.benchmark-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}
.benchmark-bar.you { background: var(--color-primary); }
.benchmark-bar.industry { background: var(--color-border); }
.benchmark-value {
  width: 60px;
  font-size: var(--text-xs);
  color: var(--color-muted);
  text-align: right;
  flex-shrink: 0;
}
.benchmark-legend {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.benchmark-legend-item { display: flex; align-items: center; gap: var(--space-1); }
.benchmark-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.benchmark-legend-dot.you { background: var(--color-primary); }
.benchmark-legend-dot.industry { background: var(--color-border); }

/* ---------- 84. Report Builder / Export Panel ---------- */
.report-builder {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-elevated);
  overflow: hidden;
}
.report-builder-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.report-builder-title { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--color-near-black); }
.report-builder-body { padding: var(--space-4); }
.report-section {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}
.report-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.report-section-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.report-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.report-option:last-child { margin-bottom: 0; }
.report-option:hover { border-color: var(--color-primary); }
.report-option.selected { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.report-option-icon { font-size: 18px; }
.report-option-info { flex: 1; }
.report-option-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-near-black); }
.report-option-desc { font-size: var(--text-xs); color: var(--color-muted); }
.report-option-check {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.report-option.selected .report-option-check { border-color: var(--color-primary); background: var(--color-primary); }
.report-option.selected .report-option-check::after { content: "✓"; color: white; font-size: 12px; font-weight: var(--weight-bold); }
.report-formats {
  display: flex;
  gap: var(--space-2);
}
.report-format-btn {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-elevated);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--color-near-black);
}
.report-format-btn:hover { border-color: var(--color-primary); }
.report-format-btn.active { border-color: var(--color-primary); background: var(--color-primary-subtle); color: var(--color-primary); }
.report-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* ---------- 85. Banner ---------- */

.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid;
  position: relative;
}
.banner-sticky { position: sticky; top: 0; z-index: var(--z-sticky); }
.banner-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}
.banner-content { flex: 1; min-width: 0; }
.banner-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: inherit;
  margin-bottom: var(--space-1);
}
.banner-desc {
  font-size: var(--text-sm);
  color: inherit;
  opacity: 0.85;
  line-height: var(--leading-relaxed);
}
.banner-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.banner-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: inherit;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}
.banner-close:hover { opacity: 1; }

/* Variants */
.banner-error {
  background: var(--color-error-subtle);
  border-color: var(--color-error-border);
  color: var(--color-error);
}
.banner-warning {
  background: var(--color-warning-subtle);
  border-color: var(--color-warning-border);
  color: var(--color-warning);
}
.banner-info {
  background: var(--color-info-subtle);
  border-color: var(--color-info-border);
  color: var(--color-info);
}
.banner-success {
  background: var(--color-success-subtle);
  border-color: var(--color-success-border);
  color: var(--color-success);
}

/* ---------- 86. Page Layouts ---------- */

.page { padding: var(--space-6); max-width: 1280px; }
.page-section { margin-bottom: var(--space-6); }
.page-section:last-child { margin-bottom: 0; }
.page-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.page-section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
}
.page-section-sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.content-grid {
  display: grid;
  gap: var(--space-5);
}
.content-grid-2 { grid-template-columns: 1fr 1fr; }
.content-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.content-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.content-grid-sidebar { grid-template-columns: 1fr 320px; }
.content-grid-main-sidebar { grid-template-columns: 260px 1fr; }
.content-card {
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.content-card-body { padding: var(--space-5); }
.content-card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.content-card-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
}

/* Stats row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}
.stat-card-page {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  background: var(--color-elevated);
}
.stat-card-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}
.stat-card-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-near-black);
  line-height: var(--leading-none);
}
.stat-card-change {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  margin-top: var(--space-2);
}
.stat-card-change.up { color: var(--color-success); }
.stat-card-change.down { color: var(--color-error); }
.stat-card-change.neutral { color: var(--color-muted); }

/* Chart containers */
.chart-container {
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.chart-container-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
  margin-bottom: var(--space-4);
}

/* Recent activity / feed list in page */
.activity-compact { }
.activity-compact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-light);
}
.activity-compact-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-compact-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-compact-dot.success { background: var(--color-success); }
.activity-compact-dot.warning { background: var(--color-warning); }
.activity-compact-dot.error { background: var(--color-error); }
.activity-compact-dot.info { background: var(--color-info); }
.activity-compact-content { flex: 1; min-width: 0; }
.activity-compact-text {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  line-height: var(--leading-normal);
}
.activity-compact-time {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: 2px;
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
  .content-grid-2,
  .content-grid-3,
  .content-grid-4 { grid-template-columns: 1fr 1fr; }
  .content-grid-sidebar { grid-template-columns: 1fr; }
  .content-grid-main-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .content-grid-2,
  .content-grid-3,
  .content-grid-4 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .page { padding: var(--space-4); }
}

/* ---------- 87. App Shell ---------- */

.shell { display: flex; flex-direction: column; height: 100%; position: relative; }
.shell-topbar {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 var(--space-4);
  gap: var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
  flex-shrink: 0;
}
.shell-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.shell-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.shell-logo-mark { display: none; }
.shell-topbar-center { flex: 1; display: flex; justify-content: center; }
.shell-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 480px;
  width: 100%;
  padding: var(--space-1) var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}
.shell-search:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-subtle); }
.shell-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.shell-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.shell-icon-btn:hover { background: var(--color-hover); color: var(--color-text-primary); }
.shell-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
}
.shell-dot-error { background: var(--color-error); }
.shell-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}
.shell-avatar-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-success);
  border: 2px solid var(--color-surface);
}
.shell-avatar-status.away { background: var(--color-warning); }
.shell-avatar-status.offline { background: var(--color-muted); }
.shell-user-menu { position: relative; }
.shell-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--color-elevated);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: var(--z-dropdown);
}
.shell-user-dropdown.open { display: block; }
.shell-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.shell-user-dropdown-item:hover { background: var(--color-hover); color: var(--color-text-primary); }
.shell-user-dropdown-divider {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--space-1) var(--space-1);
}
.shell-user-dropdown-danger { color: var(--color-error); }
.shell-user-dropdown-danger:hover { background: var(--color-error-subtle); color: var(--color-error); }
.shell-user-dropdown-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--space-1);
}
.shell-user-dropdown-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
}
.shell-user-dropdown-email {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: 1px;
}
.shell-user-dropdown-role {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--space-1);
}
.shell-vertical {
  padding: var(--space-1) 0 var(--space-3);
  margin: 0 var(--space-1);
}
.shell-vertical-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
}
.shell-vertical-row:hover { background: var(--color-hover); }
.shell-vertical-row .toggle-icon {
  flex-shrink: 0;
  color: var(--color-muted);
}
.shell-vertical-row .text-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.shell-vertical-row .text-block .label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-vertical-row .text-block .sub {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-vertical-dd {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--space-1);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  padding: var(--space-1);
  z-index: 99;
}
.shell-vertical-dd.open { display: block; }
.shell-vertical-opt {
  display: block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.shell-vertical-opt:hover { background: var(--color-hover); }
.shell-vertical-opt .inner .main {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  line-height: 1.3;
}
.shell-vertical-opt.active .inner .main { color: var(--color-primary); }
.vi-box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--color-border-light, #E0E0E0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.vi-box:hover { background: var(--color-hover); }
.shell-vertical-opt .inner .sub {
  font-size: 10px;
  font-weight: var(--weight-medium);
  color: var(--color-muted);
  line-height: 1.3;
  margin-top: 1px;
}
.shell-sidebar-help {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  margin-top: auto;
}
.shell-sidebar-help:hover { background: var(--color-hover); color: var(--color-text-primary); }
.shell-notif-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 10;
}
.shell-notif-backdrop.open { display: block; }
.shell-notif-drawer {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
  height: 100%;
  background: var(--color-elevated);
  border-left: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-xl);
  z-index: 11;
  flex-direction: column;
}
.shell-notif-drawer.open { display: flex; }
.shell-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}
.shell-notif-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-near-black);
}
.shell-notif-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
}
.shell-notif-close:hover { background: var(--color-hover); }
.shell-notif-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2) var(--space-3);
}
.shell-notif-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.shell-notif-item:hover { background: var(--color-hover); }
.shell-notif-item + .shell-notif-item { border-top: 1px solid var(--color-border-light); }
.shell-notif-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.shell-notif-icon-error { background: var(--color-error-subtle); color: var(--color-error); }
.shell-notif-icon-warning { background: var(--color-warning-subtle); color: var(--color-warning); }
.shell-notif-icon-success { background: var(--color-success-subtle); color: var(--color-success); }
.shell-notif-icon-info { background: var(--color-info-subtle); color: var(--color-info); }
.shell-notif-content { flex: 1; min-width: 0; }
.shell-notif-text {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  line-height: 1.4;
}
.shell-notif-time {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: 2px;
}
.shell-sidebar {
  width: 220px;
  border-right: 1px solid var(--color-border-light);
  background: var(--color-surface);
  overflow-y: auto;
  flex-shrink: 0;
  transition: width var(--transition-normal);
  display: flex;
  flex-direction: column;
}
.shell-sidebar-inner {
  padding: var(--space-1) var(--space-2) var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.shell-collapsed .shell-sidebar { width: 52px; }
.shell-collapsed .shell-nav-item {
  justify-content: center;
  padding: var(--space-2);
}
.shell-collapsed .shell-nav-item span { display: none; }
.shell-collapsed .shell-nav-label { display: none; }
.shell-collapsed .shell-logo-full { display: none; }
.shell-collapsed .shell-logo-mark { display: block; }
.shell-collapsed .shell-vertical-row .toggle-icon,
.shell-collapsed .shell-vertical-row .text-block,
.shell-collapsed .shell-vertical-dd { display: none; }
.shell-collapsed .shell-vertical-row { justify-content: center; padding: var(--space-2); }
.shell-collapsed .shell-sidebar-help span { display: none; }
.shell-collapsed .shell-sidebar-help { justify-content: center; padding: var(--space-2); }
.shell-nav-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.shell-nav-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) var(--space-3) var(--space-1);
}
.shell-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.shell-nav-item:hover { background: var(--color-hover); color: var(--color-text-primary); }
.shell-nav-active { background: var(--color-primary-subtle); color: var(--color-primary); font-weight: var(--weight-semibold); }
.shell-nav-active:hover { background: var(--color-primary-subtle); }
.shell-nav-danger { color: var(--color-error); }
.shell-nav-danger:hover { background: var(--color-error-subtle); color: var(--color-error); }
.shell-badge {
  margin-left: auto;
  padding: 0 6px;
  height: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--color-border-light);
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
}
.shell-badge-warning { background: var(--color-warning-subtle); color: var(--color-warning); }
.shell-content {
  flex: 1;
  overflow-y: auto;
  background: var(--color-bg);
}
.shell-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: var(--space-10) var(--space-6);
}
@media (max-width: 900px) {
  .shell-sidebar { width: 52px; }
  .shell-sidebar .shell-nav-item {
    justify-content: center;
    padding: var(--space-2);
  }
  .shell-sidebar .shell-nav-item span { display: none; }
  .shell-sidebar .shell-nav-label { display: none; }
  .shell-logo-full { display: none; }
  .shell-logo-mark { display: block; }
  .shell-vertical-row .toggle-icon,
  .shell-vertical-row .text-block,
  .shell-vertical-dd { display: none; }
  .shell-vertical-row { justify-content: center; padding: var(--space-2); }
  .shell-sidebar-help span { display: none; }
  .shell-sidebar-help { justify-content: center; padding: var(--space-2); }
}

/* ---------- Print Styles ---------- */
@media print {
  body { background: white; color: black; }
  .app-header,
  .sidebar,
  .main-content > *:not(.component-demo) { display: none !important; }
  .component-demo { padding: 0; }
  .card, .modal, .drawer, .side-sheet { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .table-wrap { border: 1px solid #ddd; }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
