/* ==========================================================================
   Components — Isracollect Premium Design System
   Complete UI component library using design tokens from variables.css
   ========================================================================== */


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.6875rem 1.375rem;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  line-height: 1;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  text-decoration: none;
}

.btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-xs);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-blue-glow), var(--shadow-sm);
}

.btn:disabled,
.btn--disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
  box-shadow: none;
}

/* Primary — Brand gradient with glow */
.btn--primary {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-500) 100%);
  border-color: var(--brand-600);
  color: var(--text-on-brand);
  box-shadow: var(--shadow-glow-brand), var(--shadow-sm);
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-600) 100%);
  border-color: var(--brand-700);
  box-shadow: 0 0 32px rgba(99, 102, 241, 0.35), var(--shadow-md);
  transform: translateY(-1px);
}

.btn--primary:active {
  background: linear-gradient(135deg, var(--brand-800) 0%, var(--brand-700) 100%);
  box-shadow: var(--shadow-glow-brand);
  transform: translateY(0) scale(0.98);
}

.btn--primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), var(--shadow-glow-brand);
}

/* Secondary */
.btn--secondary {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}

.btn--secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--brand-200);
  color: var(--brand-600);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn--secondary:active {
  background: var(--brand-50);
  transform: translateY(0) scale(0.98);
}

/* Danger */
.btn--danger {
  background: linear-gradient(135deg, var(--accent-red) 0%, #EF4444 100%);
  border-color: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.15), var(--shadow-sm);
}

.btn--danger:hover {
  background: linear-gradient(135deg, #B91C1C 0%, var(--accent-red) 100%);
  border-color: #B91C1C;
  box-shadow: 0 0 28px rgba(220, 38, 38, 0.3), var(--shadow-md);
  transform: translateY(-1px);
}

.btn--danger:active {
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.2);
  transform: translateY(0) scale(0.98);
}

.btn--danger:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-red-glow), 0 0 16px rgba(220, 38, 38, 0.15);
}

/* Success */
.btn--success {
  background: linear-gradient(135deg, var(--accent-green) 0%, #10B981 100%);
  border-color: var(--accent-green);
  color: #fff;
  box-shadow: var(--shadow-glow-green), var(--shadow-sm);
}

.btn--success:hover {
  background: linear-gradient(135deg, #047857 0%, var(--accent-green) 100%);
  border-color: #047857;
  box-shadow: 0 0 28px rgba(5, 150, 105, 0.3), var(--shadow-md);
  transform: translateY(-1px);
}

.btn--success:active {
  box-shadow: var(--shadow-glow-green);
  transform: translateY(0) scale(0.98);
}

.btn--success:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-green-glow), var(--shadow-glow-green);
}

/* Outline */
.btn--outline {
  background: transparent;
  border-color: var(--border-medium);
  color: var(--text-secondary);
  box-shadow: none;
}

.btn--outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--brand-200);
  color: var(--brand-600);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}

.btn--outline:active {
  background: var(--brand-50);
  transform: translateY(0) scale(0.98);
}

.btn--outline:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

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

.btn--ghost:active {
  background: var(--brand-50);
  transform: scale(0.98);
}

.btn--ghost:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

/* Sizes */
.btn--sm {
  padding: 0.4375rem 0.875rem;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
  gap: 6px;
}

.btn--lg {
  padding: 0.875rem 1.875rem;
  font-size: var(--font-size-base);
  border-radius: var(--radius-lg);
  gap: var(--space-sm);
}

/* Icon Button */
.btn--icon {
  padding: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.btn--icon.btn--sm {
  width: 30px;
  height: 30px;
  padding: 0;
}

.btn--icon.btn--lg {
  width: 46px;
  height: 46px;
  padding: 0;
}

/* Loading */
.btn--loading {
  color: transparent !important;
  pointer-events: none;
}

.btn--loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
}

.btn--loading.btn--secondary::after,
.btn--loading.btn--outline::after,
.btn--loading.btn--ghost::after,
.btn--loading.btn:not(.btn--primary):not(.btn--danger):not(.btn--success)::after {
  border-color: rgba(15, 23, 42, 0.12);
  border-top-color: var(--brand-600);
}

/* Full width */
.btn--full {
  width: 100%;
}

/* Button Group */
.btn-group {
  display: inline-flex;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.btn-group .btn {
  border-radius: 0;
  box-shadow: none;
}

.btn-group .btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group .btn + .btn {
  margin-left: -1px;
}

.btn-group .btn:hover {
  z-index: 1;
}


/* ==========================================================================
   FORM INPUTS
   ========================================================================== */

.form-group {
  position: relative;
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
  transition: color var(--transition-fast);
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.6875rem 0.9375rem;
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

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

.form-input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), var(--shadow-xs);
  background: var(--bg-secondary);
  outline: none;
}

/* Input Error */
.form-input--error {
  border-color: var(--accent-red);
  background: rgba(220, 38, 38, 0.02);
}

.form-input--error:focus {
  box-shadow: 0 0 0 3px var(--accent-red-glow), var(--shadow-xs);
  border-color: var(--accent-red);
}

/* Floating Label */
.form-group--floating {
  position: relative;
}

.form-group--floating .form-input {
  padding-top: 1.375rem;
  padding-bottom: 0.375rem;
}

.form-group--floating .form-label {
  position: absolute;
  top: 50%;
  left: 0.9375rem;
  transform: translateY(-50%);
  pointer-events: none;
  margin-bottom: 0;
  transition: all var(--transition-fast);
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
}

.form-group--floating .form-input:focus ~ .form-label,
.form-group--floating .form-input:not(:placeholder-shown) ~ .form-label {
  top: 0.625rem;
  transform: translateY(0);
  font-size: var(--font-size-xs);
  color: var(--brand-600);
  font-weight: var(--font-weight-semibold);
}

/* Select */
.form-select {
  display: block;
  width: 100%;
  padding: 0.6875rem 2.5rem 0.6875rem 0.9375rem;
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9375rem center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.form-select:hover {
  border-color: var(--border-medium);
}

.form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), var(--shadow-xs);
  outline: none;
}

/* Textarea */
.form-textarea {
  display: block;
  width: 100%;
  padding: 0.6875rem 0.9375rem;
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  resize: vertical;
  min-height: 100px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-textarea:hover {
  border-color: var(--border-medium);
}

.form-textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), var(--shadow-xs);
  outline: none;
}

/* Checkbox */
.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  user-select: none;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  appearance: none;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.form-checkbox input[type="checkbox"]:hover {
  border-color: var(--brand-400);
}

.form-checkbox input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-500) 100%);
  border-color: var(--brand-600);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.form-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.form-checkbox input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

/* Radio */
.form-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  user-select: none;
}

.form-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  appearance: none;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.form-radio input[type="radio"]:hover {
  border-color: var(--brand-400);
}

.form-radio input[type="radio"]:checked {
  border-color: var(--brand-600);
  border-width: 2px;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.form-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-500) 100%);
  border-radius: var(--radius-full);
}

.form-radio input[type="radio"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

/* Error State — wrapper class */
.form-error .form-input,
.form-error .form-select,
.form-error .form-textarea {
  border-color: var(--accent-red);
  background: rgba(220, 38, 38, 0.02);
}

.form-error .form-input:focus,
.form-error .form-select:focus,
.form-error .form-textarea:focus {
  box-shadow: 0 0 0 3px var(--accent-red-glow), var(--shadow-xs);
}

.form-error .form-label {
  color: var(--accent-red);
}

.form-error__message {
  font-size: var(--font-size-xs);
  color: var(--accent-red);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 6px;
}


/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: rgba(79, 70, 229, 0.12);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

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

.card__subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

.card__body {
  color: var(--text-secondary);
  line-height: var(--line-height-normal);
}

.card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

/* Glass Card — Glassmorphism for hero/category sections */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

.glass-card:hover {
  border-color: rgba(79, 70, 229, 0.15);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

/* Card no hover */
.card--static {
  cursor: default;
}

.card--static:hover {
  transform: none;
  box-shadow: var(--shadow-card);
  border-color: var(--border-card);
}


/* ==========================================================================
   BADGES
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge--brand {
  background: rgba(99, 102, 241, 0.08);
  color: var(--brand-600);
  border-color: rgba(99, 102, 241, 0.18);
}

.badge--blue {
  background: rgba(99, 102, 241, 0.08);
  color: var(--brand-600);
  border-color: rgba(99, 102, 241, 0.18);
}

.badge--green {
  background: rgba(5, 150, 105, 0.08);
  color: var(--accent-green);
  border-color: rgba(5, 150, 105, 0.18);
}

.badge--red {
  background: rgba(220, 38, 38, 0.08);
  color: var(--accent-red);
  border-color: rgba(220, 38, 38, 0.18);
}

.badge--orange {
  background: rgba(217, 119, 6, 0.08);
  color: var(--accent-orange);
  border-color: rgba(217, 119, 6, 0.18);
}

/* Notification Count */
.badge--count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.625rem;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-red) 0%, #EF4444 100%);
  color: #fff;
  border: 2px solid var(--bg-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.badge--count--pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Badge dot */
.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}


/* ==========================================================================
   ALERTS
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-500);
  background: var(--bg-secondary);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-normal);
  box-shadow: var(--shadow-xs);
}

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

.alert__content {
  flex: 1;
  min-width: 0;
}

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

.alert--info {
  border-left-color: var(--brand-500);
  background: rgba(99, 102, 241, 0.04);
}

.alert--info .alert__icon {
  color: var(--brand-500);
}

.alert--success {
  border-left-color: var(--accent-green);
  background: rgba(5, 150, 105, 0.04);
}

.alert--success .alert__icon {
  color: var(--accent-green);
}

.alert--warning {
  border-left-color: var(--accent-orange);
  background: rgba(217, 119, 6, 0.04);
}

.alert--warning .alert__icon {
  color: var(--accent-orange);
}

.alert--error {
  border-left-color: var(--accent-red);
  background: rgba(220, 38, 38, 0.04);
}

.alert--error .alert__icon {
  color: var(--accent-red);
}


/* ==========================================================================
   MODALS
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

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

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal__content {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  transform: scale(0.92) translateY(16px);
  transition: transform var(--transition-base);
}

.modal--open .modal__content {
  transform: scale(1) translateY(0);
  animation: scaleIn var(--transition-base) both;
}

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

.modal__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 0;
  letter-spacing: var(--letter-spacing-tight);
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  border: none;
  background: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.modal__close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.modal__body {
  padding: var(--space-lg);
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Modal Sizes */
.modal__content--sm {
  max-width: 360px;
}

.modal__content--lg {
  max-width: 640px;
}

.modal__content--xl {
  max-width: 800px;
}

.modal__content--full {
  max-width: calc(100vw - var(--space-xl));
  max-height: calc(100vh - var(--space-xl));
  max-height: calc(100dvh - var(--space-xl));
}


/* ==========================================================================
   TOASTS
   ========================================================================== */

.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  max-width: 420px;
  width: calc(100% - var(--space-xl));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  animation: toastIn var(--transition-base) both;
  position: relative;
  overflow: hidden;
}

.toast--dismissing {
  animation: toastOut var(--transition-fast) both;
}

.toast__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast__content {
  flex: 1;
  min-width: 0;
}

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

.toast__message {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-normal);
}

.toast__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.toast__close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  animation: progressFill 5s linear forwards;
  width: 100%;
  transform-origin: left;
}

/* Toast Variants */
.toast--success {
  border-left: 3px solid var(--accent-green);
}

.toast--success .toast__icon {
  color: var(--accent-green);
}

.toast--success .toast__progress {
  background: linear-gradient(90deg, var(--accent-green), #34D399);
}

.toast--error {
  border-left: 3px solid var(--accent-red);
}

.toast--error .toast__icon {
  color: var(--accent-red);
}

.toast--error .toast__progress {
  background: linear-gradient(90deg, var(--accent-red), #F87171);
}

.toast--warning {
  border-left: 3px solid var(--accent-orange);
}

.toast--warning .toast__icon {
  color: var(--accent-orange);
}

.toast--warning .toast__progress {
  background: linear-gradient(90deg, var(--accent-orange), #FBBF24);
}

.toast--info {
  border-left: 3px solid var(--brand-500);
}

.toast--info .toast__icon {
  color: var(--brand-500);
}

.toast--info .toast__progress {
  background: linear-gradient(90deg, var(--brand-600), var(--brand-400));
}


/* ==========================================================================
   TABLES
   ========================================================================== */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  background: var(--bg-secondary);
}

.table {
  width: 100%;
  text-align: left;
  font-size: var(--font-size-sm);
  border-collapse: collapse;
}

.table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.table th {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.table td {
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: rgba(99, 102, 241, 0.03);
}

.table--striped tbody tr:nth-child(even) {
  background: var(--bg-tertiary);
}

.table--striped tbody tr:nth-child(even):hover {
  background: rgba(99, 102, 241, 0.05);
}

.table--compact th,
.table--compact td {
  padding: var(--space-xs) var(--space-sm);
}


/* ==========================================================================
   TABS
   ========================================================================== */

.tabs {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  border-bottom: 2px solid var(--border-subtle);
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

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

.tab--active {
  color: var(--brand-600);
  border-bottom-color: var(--brand-600);
  font-weight: var(--font-weight-semibold);
}

.tab__indicator {
  position: absolute;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-600), var(--brand-400));
  border-radius: 1px;
  transition: left var(--transition-base), width var(--transition-base);
}

.tabs__content {
  padding-top: var(--space-md);
}

.tab-panel {
  display: none;
}

.tab-panel--active {
  display: block;
  animation: fadeIn var(--transition-fast) both;
}


/* ==========================================================================
   DROPDOWN
   ========================================================================== */

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

.dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  padding: var(--space-xs);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.dropdown__menu--right {
  left: auto;
  right: 0;
}

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

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  border: none;
  background: none;
  font-family: var(--font-family);
  text-decoration: none;
}

.dropdown__item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

.dropdown__item--danger:hover {
  background: rgba(220, 38, 38, 0.06);
  color: var(--accent-red);
}

.dropdown__item--active {
  color: var(--brand-600);
  background: rgba(99, 102, 241, 0.05);
}

.dropdown__item--active:hover {
  background: rgba(99, 102, 241, 0.08);
}

.dropdown__item-icon {
  display: flex;
  align-items: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.dropdown__divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-xs) 0;
}

.dropdown__label {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
}


/* ==========================================================================
   TOOLTIP
   ========================================================================== */

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

.tooltip__content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.92);
  padding: 6px 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-inverse);
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  z-index: var(--z-tooltip);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  pointer-events: none;
}

/* Arrow */
.tooltip__content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-dark);
}

.tooltip:hover .tooltip__content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

/* Tooltip positions */
.tooltip--bottom .tooltip__content {
  bottom: auto;
  top: calc(100% + 8px);
}

.tooltip--bottom .tooltip__content::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--bg-dark);
}

.tooltip--left .tooltip__content {
  bottom: auto;
  top: 50%;
  left: auto;
  right: calc(100% + 8px);
  transform: translateY(-50%) scale(0.92);
}

.tooltip--left:hover .tooltip__content {
  transform: translateY(-50%) scale(1);
}

.tooltip--left .tooltip__content::after {
  top: 50%;
  left: 100%;
  bottom: auto;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: var(--bg-dark);
}

.tooltip--right .tooltip__content {
  bottom: auto;
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%) scale(0.92);
}

.tooltip--right:hover .tooltip__content {
  transform: translateY(-50%) scale(1);
}

.tooltip--right .tooltip__content::after {
  top: 50%;
  right: 100%;
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--bg-dark);
}


/* ==========================================================================
   PROGRESS BAR
   ========================================================================== */

.progress {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.progress--sm {
  height: 4px;
}

.progress--lg {
  height: 10px;
}

.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-600), var(--brand-400));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  position: relative;
}

.progress__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  border-radius: inherit;
}

.progress__bar--green {
  background: linear-gradient(90deg, var(--accent-green), #34D399);
}

.progress__bar--orange {
  background: linear-gradient(90deg, var(--accent-orange), #FBBF24);
}

.progress__bar--red {
  background: linear-gradient(90deg, var(--accent-red), #F87171);
}

.progress__bar--animated {
  animation: progressFill 1s ease-out both;
}

.progress__bar--striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.12) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.12) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
}

.progress-label__text {
  color: var(--text-secondary);
}

.progress-label__value {
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}


/* ==========================================================================
   SKELETON LOADERS
   ========================================================================== */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton--text {
  height: 1em;
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-sm);
}

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

.skeleton--title {
  height: 1.5em;
  width: 40%;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-sm);
}

.skeleton--image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
}

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

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

.skeleton--card {
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border-subtle);
  min-height: 160px;
}

.skeleton--button {
  width: 120px;
  height: 38px;
  border-radius: var(--radius-md);
}

.skeleton--shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-card-hover) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}


/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.pagination__item:hover {
  background: var(--bg-tertiary);
  border-color: var(--brand-200);
  color: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pagination__item--active {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-500) 100%);
  border-color: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-glow-brand);
}

.pagination__item--active:hover {
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-600) 100%);
  border-color: var(--brand-700);
  color: #fff;
  box-shadow: 0 0 28px rgba(99, 102, 241, 0.3);
}

.pagination__item--disabled {
  opacity: 0.35;
  pointer-events: none;
  box-shadow: none;
}

.pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  letter-spacing: 0.1em;
}


/* ==========================================================================
   TOGGLE / SWITCH (iOS-style)
   ========================================================================== */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  user-select: none;
}

.toggle__input {
  width: 44px;
  height: 24px;
  appearance: none;
  background: var(--border-medium);
  border: none;
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  flex-shrink: 0;
}

.toggle__input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.toggle__input:checked,
.toggle--checked .toggle__input {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-500) 100%);
}

.toggle__input:checked::after,
.toggle--checked .toggle__input::after {
  transform: translateX(20px);
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.3), 0 1px 2px rgba(0, 0, 0, 0.08);
}

.toggle__input:hover {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.toggle__input:checked:hover {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.toggle__input:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  outline: none;
}

.toggle__label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}


/* ==========================================================================
   AVATAR
   ========================================================================== */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  position: relative;
}

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

.avatar--sm {
  width: 30px;
  height: 30px;
  border-width: 1.5px;
}

.avatar--lg {
  width: 56px;
  height: 56px;
  border-width: 2.5px;
}

.avatar--xl {
  width: 72px;
  height: 72px;
  border-width: 3px;
}

.avatar--placeholder {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--brand-600);
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-100) 100%);
  border-color: rgba(99, 102, 241, 0.15);
}

.avatar--placeholder.avatar--sm {
  font-size: var(--font-size-xs);
}

.avatar--placeholder.avatar--lg {
  font-size: var(--font-size-xl);
}

.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  margin-left: -8px;
  border: 2.5px solid var(--bg-secondary);
  transition: transform var(--transition-fast);
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

.avatar-group .avatar:hover {
  transform: translateY(-2px);
  z-index: 1;
}


/* ==========================================================================
   DIVIDER
   ========================================================================== */

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  margin: var(--space-lg) 0;
  border: none;
}

.divider--text {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: auto;
  background: none;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
}

.divider--text::before,
.divider--text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle));
}

.divider--text::after {
  background: linear-gradient(90deg, var(--border-subtle), transparent);
}


/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

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

.empty-state__icon {
  width: 56px;
  height: 56px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  opacity: 0.5;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state__icon svg,
.empty-state__icon i {
  width: 24px;
  height: 24px;
}

.empty-state__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  letter-spacing: var(--letter-spacing-tight);
}

.empty-state__text,
.empty-state__description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  max-width: 360px;
  margin-bottom: var(--space-lg);
  line-height: var(--line-height-normal);
}


/* ==========================================================================
   DRAWER
   ========================================================================== */

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: var(--z-drawer);
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-2xl);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-base);
}

.drawer--right {
  right: 0;
}

.drawer--left {
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border-subtle);
  transform: translateX(-100%);
}

.drawer--open {
  transform: translateX(0);
  animation: slideInRight var(--transition-base) both;
}

.drawer--left.drawer--open {
  animation: none;
  transform: translateX(0);
}

.drawer__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: calc(var(--z-drawer) - 1);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.drawer__backdrop--visible {
  opacity: 1;
  visibility: visible;
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.drawer__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 0;
  letter-spacing: var(--letter-spacing-tight);
}

.drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  border: none;
  background: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.drawer__close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-lg);
}

.drawer__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}


/* ==========================================================================
   BOTTOM SHEET
   ========================================================================== */

.bottom-sheet {
  display: none;
}

@media (max-width: 1023px) {
  .bottom-sheet {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-modal);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-2xl);
    transform: translateY(100%);
    transition: transform var(--transition-base);
    max-height: 85vh;
    max-height: 85dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .bottom-sheet--open {
    transform: translateY(0);
    animation: bottomSheetUp var(--transition-base) both;
  }

  .bottom-sheet__handle {
    display: flex;
    justify-content: center;
    padding: var(--space-sm) 0;
    flex-shrink: 0;
    cursor: grab;
  }

  .bottom-sheet__handle::after {
    content: '';
    width: 40px;
    height: 4px;
    background: var(--border-medium);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
  }

  .bottom-sheet__handle:hover::after {
    background: var(--text-tertiary);
  }

  .bottom-sheet__content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 var(--space-lg) var(--space-lg);
    -webkit-overflow-scrolling: touch;
  }

  .bottom-sheet__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
  }

  .bottom-sheet__backdrop--visible {
    opacity: 1;
    visibility: visible;
  }
}


/* ==========================================================================
   CHIPS
   ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 5px 14px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  cursor: default;
}

.chip:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.chip--dismissible {
  padding-right: var(--space-xs);
}

.chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  transition: all var(--transition-fast);
  cursor: pointer;
  line-height: 1;
}

.chip__remove:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--accent-red);
}

.chip--selected {
  background: rgba(99, 102, 241, 0.08);
  color: var(--brand-600);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.08);
}


/* ==========================================================================
   STAT CARD
   ========================================================================== */

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

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

.stat-card__label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  font-weight: var(--font-weight-medium);
}

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

.stat-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  margin-top: var(--space-sm);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.stat-card__trend--up {
  color: var(--accent-green);
  background: rgba(5, 150, 105, 0.08);
}

.stat-card__trend--down {
  color: var(--accent-red);
  background: rgba(220, 38, 38, 0.08);
}


/* ==========================================================================
   SEARCH INPUT
   ========================================================================== */

.search {
  position: relative;
}

.search__icon {
  position: absolute;
  left: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search:focus-within .search__icon {
  color: var(--brand-500);
}

.search__input {
  width: 100%;
  padding: 0.5625rem 0.875rem 0.5625rem 2.125rem;
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search__input::placeholder {
  color: var(--text-tertiary);
}

.search__input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), var(--shadow-xs);
  outline: none;
}

.search__shortcut {
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 7px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  pointer-events: none;
}


/* ==========================================================================
   LIST
   ========================================================================== */

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

.list__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.list__item:last-child {
  border-bottom: none;
}

.list__item:hover {
  background: rgba(99, 102, 241, 0.03);
}

.list__item--active {
  background: rgba(99, 102, 241, 0.06);
  border-left: 3px solid var(--brand-600);
}


/* ==========================================================================
   KEYFRAME ANIMATIONS (used by components above)
   ========================================================================== */

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

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

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

@keyframes progressFill {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes bottomSheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
