/* Card — opaque surface (no backdrop-filter: blur was a major scroll-jank
   source on mobile). */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}
.card:active {
  box-shadow: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-3) var(--spacing-6);
  border-radius: var(--radius-full);
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s, box-shadow 0.3s;
  gap: var(--spacing-2);
}
.btn:hover {
  opacity: 0.95;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 4px 12px rgba(32, 90, 99, 0.3);
}
.btn:active {
  transform: translateY(1px) scale(0.95);
}
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-icon {
  padding: var(--spacing-2);
  border-radius: var(--radius-full);
}

/* Forms */
.input-group {
  position: relative;
  margin-bottom: var(--spacing-4);
}
.input, .textarea, .select {
  width: 100%;
  padding: var(--spacing-3) var(--spacing-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: 1rem;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.label {
  display: block;
  margin-bottom: var(--spacing-1);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Avatar */
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  font-size: 1.25rem;
  background-color: var(--primary-light);
  color: var(--primary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: var(--spacing-1) var(--spacing-2);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* FAB */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--spacing-4));
  right: var(--spacing-4);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  z-index: 50;
  transition: transform 0.2s ease;
}
.fab:active {
  transform: scale(0.9);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-8);
  text-align: center;
  color: var(--text-secondary);
}
.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: var(--spacing-4);
  opacity: 0.5;
}

/* Sticky Note */
.sticky-note {
  background: #fef08a;
  padding: var(--spacing-3);
  border-radius: 4px 4px 4px 20px;
  box-shadow: var(--shadow-sm);
  color: #854d0e;
  position: relative;
  font-family: 'Heebo', sans-serif;
}
.sticky-note::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.1);
  border-top-right-radius: 4px;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* Chip */
.chips-container {
  display: flex;
  gap: var(--spacing-2);
  overflow-x: auto;
  padding-bottom: var(--spacing-2);
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.chips-container::-webkit-scrollbar {
  display: none;
}
.chip {
  padding: var(--spacing-2) var(--spacing-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}
.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  padding: var(--spacing-6);
  z-index: 101;
  transform: translateY(100%);
  transition: transform var(--transition-normal);
  max-height: 90vh;
  overflow-y: auto;
}
.modal.open {
  transform: translateY(0);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-4);
}

/* Toast */
.toast-container {
  position: fixed;
  top: var(--spacing-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  width: 90%;
  max-width: 400px;
}
.toast {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-3) var(--spacing-4);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  transform: translateY(-20px);
  opacity: 0;
  transition: all var(--transition-normal);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Swipe action */
.swipe-container {
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-md);
}
.swipe-content {
  background: var(--bg-surface);
  position: relative;
  z-index: 2;
  transition: transform 0.2s ease-out;
}
.swipe-actions {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  z-index: 1;
}
.swipe-action-left {
  background: var(--danger);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 var(--spacing-4);
  width: 100%;
}
.swipe-action-right {
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 var(--spacing-4);
  width: 100%;
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
