/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 10px 20px;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--leading-none);
  color: var(--color-white);
  background: var(--color-primary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  background: var(--color-primary-light);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Variants */
.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover {
  background: var(--color-primary-light);
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--secondary:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

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

.btn--ghost:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
  box-shadow: none;
}

.btn--danger {
  background: var(--color-error);
  color: var(--color-white);
}

.btn--danger:hover {
  background: #c0392b;
}

.btn--success {
  background: var(--color-success);
  color: var(--color-white);
}

.btn--success:hover {
  background: #219a52;
}

.btn--warning {
  background: var(--color-warning);
  color: var(--color-white);
}

.btn--warning:hover {
  background: #d68910;
}

.btn--info {
  background: var(--color-info);
  color: var(--color-white);
}

.btn--info:hover {
  background: #2980b9;
}

/* Sizes */
.btn--sm {
  padding: 6px 12px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: 14px 28px;
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--icon {
  padding: 8px;
  border-radius: var(--radius-md);
  min-width: 36px;
  min-height: 36px;
}

.btn--icon.btn--sm {
  padding: 4px;
  min-width: 28px;
  min-height: 28px;
}

/* ========================================
   Forms
   ======================================== */

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--spacing-xs);
}

.form-label--required::after {
  content: ' *';
  color: var(--color-error);
}

.form-input,
.form-textarea,
.form-select {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  appearance: none;
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--color-text-light);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-muted);
}

.form-input--error {
  border-color: var(--color-error);
}

.form-input--error:focus {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
  border-color: var(--color-error);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: var(--leading-relaxed);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234A4A5E' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  color: var(--color-text);
}

.form-error {
  font-size: var(--text-sm);
  color: var(--color-error);
  margin-top: var(--spacing-xs);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--spacing-xs);
}

/* Checkbox & Radio */
.form-checkbox,
.form-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  font-size: var(--text-base);
  color: var(--color-text);
}

.form-checkbox input[type="checkbox"],
.form-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

/* Switch */
.form-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
}

.form-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.form-switch__track {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.form-switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--color-white);
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.form-switch input:checked + .form-switch__track {
  background: var(--color-accent);
}

.form-switch input:checked + .form-switch__track::after {
  transform: translateX(20px);
}

.form-switch input:focus-visible + .form-switch__track {
  box-shadow: var(--shadow-focus);
}

/* File Input */
.form-file {
  position: relative;
}

.form-file input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  top: 0;
  left: 0;
}

.form-file__label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 10px 14px;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.form-file__label:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ========================================
   Cards
   ======================================== */

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}

.card--clickable {
  cursor: pointer;
}

.card--clickable:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card__body {
  padding: var(--spacing-lg);
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.card__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: 0;
}

.card__footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg);
}

/* ========================================
   Tables
   ======================================== */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table__head {
  background: var(--color-bg-alt);
  font-weight: var(--weight-semibold);
}

.table__th {
  padding: var(--spacing-md) var(--spacing-md);
  text-align: left;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  user-select: none;
}

.table__th--sortable {
  cursor: pointer;
}

.table__th--sortable:hover {
  color: var(--color-primary);
}

.table__th--asc::after {
  content: ' ↑';
  font-size: var(--text-xs);
}

.table__th--desc::after {
  content: ' ↓';
  font-size: var(--text-xs);
}

.table__td {
  padding: var(--spacing-md) var(--spacing-md);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
  vertical-align: middle;
}

.table__row {
  transition: background var(--transition-fast);
}

.table__row:hover {
  background: var(--color-bg);
}

.table__row--active {
  background: rgba(20, 168, 158, 0.06);
}

.table__row--active .table__td {
  color: var(--color-accent-dark);
}

.table__row--deleted {
  background: rgba(231, 76, 60, 0.04);
}

.table__row--deleted .table__td {
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.table--striped .table__row:nth-child(even) {
  background: var(--color-bg);
}

.table--hover .table__row:hover {
  background: rgba(20, 168, 158, 0.04);
}

.table--responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table--responsive .table {
  min-width: 600px;
}

/* ========================================
   Modals
   ======================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 31, 63, 0.6);
  animation: fadeIn var(--transition-base);
}

.modal.is-open .modal__overlay {
  animation: fadeIn var(--transition-base);
}

.modal__container {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp var(--transition-slow);
  z-index: 1;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--color-border-light);
}

.modal__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin: 0;
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--text-xl);
  transition: all var(--transition-fast);
}

.modal__close:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.modal__body {
  padding: var(--spacing-xl);
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-xl);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg);
}

.modal--fullscreen {
  padding: 0;
}

.modal--fullscreen .modal__container {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  border-radius: 0;
}

/* ========================================
   Alerts
   ======================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  margin-bottom: var(--spacing-lg);
  animation: slideDown var(--transition-base);
}

.alert--success {
  background: rgba(39, 174, 96, 0.08);
  border-color: rgba(39, 174, 96, 0.3);
  color: #1e8449;
}

.alert--warning {
  background: rgba(243, 156, 18, 0.08);
  border-color: rgba(243, 156, 18, 0.3);
  color: #b7950b;
}

.alert--error {
  background: rgba(231, 76, 60, 0.08);
  border-color: rgba(231, 76, 60, 0.3);
  color: #c0392b;
}

.alert--info {
  background: rgba(52, 152, 219, 0.08);
  border-color: rgba(52, 152, 219, 0.3);
  color: #2471a3;
}

.alert__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.alert__body {
  flex: 1;
}

.alert__title {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  margin-bottom: 2px;
}

.alert__text {
  font-size: var(--text-sm);
  color: inherit;
  opacity: 0.9;
}

.alert__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  font-size: var(--text-lg);
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.alert__close:hover {
  opacity: 1;
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  list-style: none;
  padding: 0;
  margin: var(--spacing-lg) 0;
}

.pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--spacing-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.pagination__item:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  text-decoration: none;
}

.pagination__item--active {
  color: var(--color-white);
  background: var(--color-accent);
  border-color: var(--color-accent);
  cursor: default;
}

.pagination__item--disabled {
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.5;
}

/* ========================================
   Breadcrumbs
   ======================================== */

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-md);
}

.breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-sm);
}

.breadcrumbs__link {
  color: var(--color-text-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumbs__link:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.breadcrumbs__separator {
  color: var(--color-text-muted);
  margin: 0 var(--spacing-xs);
  font-size: var(--text-xs);
  user-select: none;
}

.breadcrumbs__current {
  color: var(--color-text);
  font-weight: var(--weight-medium);
}

/* ========================================
   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(--spacing-md) var(--spacing-lg);
  background: var(--color-white);
  border: none;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.accordion__trigger:hover {
  background: var(--color-bg);
}

.accordion__icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.accordion__item.is-open .accordion__icon {
  transform: rotate(180deg);
}

.accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-base);
  padding: 0 var(--spacing-lg);
}

.accordion__item.is-open .accordion__content {
  max-height: 500px;
  padding: 0 var(--spacing-lg) var(--spacing-lg);
}

/* ========================================
   Tabs
   ======================================== */

.tabs {
  display: flex;
  flex-direction: column;
}

.tabs__nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabs__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tabs__btn:hover {
  color: var(--color-primary);
}

.tabs__btn--active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.tabs__content {
  padding-top: var(--spacing-lg);
}

.tabs__panel {
  display: none;
  animation: fadeIn var(--transition-base);
}

.tabs__panel.is-active {
  display: block;
}

/* ========================================
   Badges
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-normal);
  border-radius: var(--radius-full);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--success {
  background: rgba(39, 174, 96, 0.12);
  color: #1e8449;
}

.badge--warning {
  background: rgba(243, 156, 18, 0.12);
  color: #b7950b;
}

.badge--error {
  background: rgba(231, 76, 60, 0.12);
  color: #c0392b;
}

.badge--info {
  background: rgba(52, 152, 219, 0.12);
  color: #2471a3;
}

.badge--sm {
  padding: 0 6px;
  font-size: 10px;
}

.badge--lg {
  padding: 4px 14px;
  font-size: var(--text-sm);
}

/* ========================================
   Dropdown
   ======================================== */

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

.dropdown__toggle {
  cursor: pointer;
}

.dropdown__menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all var(--transition-fast);
  margin-top: var(--spacing-xs);
  overflow: hidden;
}

.dropdown.is-open .dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.dropdown__item:hover {
  background: var(--color-bg);
  text-decoration: none;
}

.dropdown__item--danger {
  color: var(--color-error);
}

.dropdown__divider {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--spacing-xs) 0;
}

/* ========================================
   Tooltip
   ======================================== */

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: var(--z-dropdown);
  padding: 6px 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-white);
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

.tooltip--top::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
}

.tooltip--top:hover::after {
  transform: translateX(-50%) translateY(-8px);
}

.tooltip--bottom::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
}

.tooltip--bottom:hover::after {
  transform: translateX(-50%) translateY(8px);
}

/* ========================================
   Progress
   ======================================== */

.progress {
  width: 100%;
  height: 8px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  min-width: 0;
}

.progress__bar--success {
  background: var(--color-success);
}

.progress__bar--warning {
  background: var(--color-warning);
}

/* ========================================
   Loader & Skeleton
   ======================================== */

.loader {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.loader--sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.loader--lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.skeleton {
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, var(--color-border-light) 50%, var(--color-bg-alt) 75%);
  background-size: 200% 100%;
  animation: pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton--text {
  height: 14px;
  margin-bottom: var(--spacing-sm);
  width: 100%;
}

.skeleton--text:last-child {
  width: 60%;
}

.skeleton--title {
  height: 24px;
  width: 40%;
  margin-bottom: var(--spacing-md);
}

.skeleton--avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
}

.skeleton--thumb {
  width: 100%;
  height: 180px;
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
  position: fixed;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-border);
  min-width: 300px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastIn var(--transition-slow) ease forwards;
}

.toast--success {
  border-left-color: var(--color-success);
}

.toast--error {
  border-left-color: var(--color-error);
}

.toast--warning {
  border-left-color: var(--color-warning);
}

.toast--info {
  border-left-color: var(--color-info);
}

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast__body {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.toast__close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.toast__close:hover {
  color: var(--color-text);
}

.toast.removing {
  animation: toastOut var(--transition-slow) ease forwards;
}

/* ========================================
   Avatars
   ======================================== */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-white);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  overflow: hidden;
  flex-shrink: 0;
}

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

.avatar--sm {
  width: 28px;
  height: 28px;
  font-size: var(--text-xs);
}

.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: var(--text-xl);
}

.avatar--rounded {
  border-radius: var(--radius-full);
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-4xl) var(--spacing-lg);
  text-align: center;
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-lg);
  opacity: 0.5;
}

.empty-state__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
}

.empty-state__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 320px;
  margin-bottom: var(--spacing-lg);
}

/* ========================================
   Stat Card
   ======================================== */

.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  transition: box-shadow var(--transition-fast);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-card__body {
  flex: 1;
}

.stat-card__value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  line-height: var(--leading-tight);
}

.stat-card__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--spacing-xs);
}

.stat-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(20, 168, 158, 0.1);
  color: var(--color-accent);
  flex-shrink: 0;
}

.stat-card__change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  margin-top: var(--spacing-sm);
}

.stat-card__change--up {
  color: var(--color-success);
}

.stat-card__change--down {
  color: var(--color-error);
}

/* ========================================
   Timeline
   ======================================== */

.timeline {
  position: relative;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border-light);
}

.timeline__item {
  position: relative;
  padding-left: 48px;
  padding-bottom: var(--spacing-lg);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: 9px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  border: 3px solid var(--color-white);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline__dot--success {
  background: var(--color-success);
  box-shadow: 0 0 0 2px var(--color-success);
}

.timeline__dot--warning {
  background: var(--color-warning);
  box-shadow: 0 0 0 2px var(--color-warning);
}

.timeline__dot--error {
  background: var(--color-error);
  box-shadow: 0 0 0 2px var(--color-error);
}

.timeline__content {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.timeline__time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-xs);
}

.timeline__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: 2px;
}

.timeline__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

/* ========================================
   Keyframe Animations
   ======================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes pulse {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

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